-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
makefiles/tools/serial.inc.mk: make use of pyterm session names #20121
Conversation
fe2f5fb
to
df88e77
Compare
df88e77
to
2933bbc
Compare
Wait a second before merging: I think I encoded the timestamp in the pyterm logfile name in a previous version but got annoyed of logfiles piling up. I any case I wonder whether this setting should be make in the build system or rather in pyterm itself. Edit: At least the timestamp configuration. If we want to have board and application in there, it has to come from the environment. |
Looks like this did stop the Murdock build, I'll cancel this now |
Well the logfiles are piling up either way, with this they are at least somewhat useful. |
I guess the question is whether one consider a one huge log file or an insane number of log files as more disturbing. How about creating subdirectories per board and creating/updating a tarball upon start for old log files? |
The huge file is worse for sure because it's almost impossible to find anything in it. How about moving the log files to |
Why do you think that is easier to find anything in a plethora of files?
In that case I would rather vote for disabling logging by default at all. In the end, it's a matter of personal preferences. Pyterm used to have a config file, but I just realized that the functionality is broken in newer python versions. But I think having a personal config file would be probably the best way to cater all different needs. |
Because now it's basically random which session gets written if you have multiple instances of
I'm also fine with that, I guess 99% of the users don't even know that the logging exists and we are just silently wasting disk space there. |
How about saving the logs to |
Well, my originally thinking was that enabling logging per default to a non-volatile location may be helpful in many cases where you only realize that you would have needed the log afterwards - potentially weeks later. But probably the most reasonable option would be to re-enable the config file again, disable logging per default, provide documentation, and leave everything up to the user. |
But in that case individual log files per session would make more sense, otherwise you just have one gargantuan file that might contain the log you need if you are lucky. |
That's true. I don't know if the behavior of Python's logging module has changed over the years or if I just thought about the use case of having to concurrent pyterms. |
So how should we proceed? |
I would say: disable logging per default in pyterm itself. |
I think this is still useful. I'll do a follow-up to make logging off by default, but when it's enabled we should have separate files per session. |
Contribution description
pyterm
loggs all terminal output but the feature is very under-utilized.Especially when multiple terminals are opened, this is very unreliable as all output goes to the default log file, so it is rather random which output gets logged.
Instead, create a session name based on the current time, the application and the board.
This helps recovering output later on.
Testing procedure
Run
make term
as usual, but now you will find multiple log files in~/.pyterm
:Issues/PRs references