logger: remove deprecated compat logger #3273
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.
Split into two commits, each with a description of the changes in the commit message bodies.
Things to note:
LogRecord
class, log calls cannot use the curly bracket format style with custom LogRecord args anymore, likelog.info("foo {0}", bar)
. The default Python behavior is the percent format style, but that's not recommended here, as log messages should all be pre-formatted via f-strings or string.format calls, to make them independent of the logging implementation.[18:30:35,123]
to[18:30:35.123456]
created
attribute gets used viadatetime.fromtimestamp(record.created)
anddatetime.strftime("%f")
, as it already contains the microseconds value. This also fixes a formatting bug that could result into logging something like this[18:27:35,1000]
, which was supposed to be fixed by cli.main: fix msecs format in logging output #3025.ConsoleOutput
had theset_level
method for changing the log level of the main logger class.ConsoleOutput
is supposed to write to stdout/stderr directly and is thus unrelated to the logger.