New formats for the logging instances #3639
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The fixed-width component of our logging format, with the first 12 characters being devoted to the module name, was fine when the module names were all short, like most of
openshot_qt.classes
. It meant that everything would line up nicely in the output.But now that most of our module names are longer than 12 characters (like basically every other name except
export
), it's just silly. Nothing really lines up anyway, and the indentation just means that the few modules with short names are wasting space at the start of their log lines.So, this PR proposes to change the format to place the log level before the module name, with everything taking only the space it requires. I tried a couple of different formats:
and decided I found the second one more readable and less "busy".
It also sets a separate formatter for the logfile output, turning on
HH:MM:SS
timestamps only for the logs written to disk (not the runtime console output).With this change, starting up OpenShot on my system goes from this:
To this:
With the logfile containing, for the same period:
I don't find the loss of (very occasional) alignment really detracts from readability, and being able to see the message severity at a glance is actually helpful.