logger: remove deprecated compat logger#3273
Merged
back-to merged 2 commits intoOct 21, 2020
Merged
Conversation
back-to
reviewed
Oct 19, 2020
eedb834 to
801f59c
Compare
Member
Author
|
I will open a PR later that corrects all log calls in every Streamlink module. After that PR has been merged, I'm going to remove the custom |
- remove old Logger and LoggerModule classes
- remove old {,Compat}LogRecord classes
- remove deprecated and unneeded methods from StreamlinkLogger
- remove usage of old Logger from Session
- remove session reference from ConsoleOutput
- Format time via datetime.strftime instead of time.strftime This avoids needing to format the logrecord's msecs separately - Change datefmt of trace level logging to "%H:%M:%S.%f" - Remove redundant StringFormatter.format code - Fix StringFormatter.usesTime() being called twice during format - Calculate usesTime value only once (depends on format, not record) - Add tests
801f59c to
70dc809
Compare
snorkelopsstgtesting1-spec
pushed a commit
to snorkel-marlin-repos/streamlink_streamlink_pr_3273_8f55ed37-c2ef-4ecc-a4e6-892b65e85c58
that referenced
this pull request
Oct 22, 2025
Original PR #3273 by bastimeyer Original: streamlink/streamlink#3273
snorkelopstesting3-bot
added a commit
to snorkel-marlin-repos/streamlink_streamlink_pr_3273_8f55ed37-c2ef-4ecc-a4e6-892b65e85c58
that referenced
this pull request
Oct 22, 2025
Merged from original PR #3273 Original: streamlink/streamlink#3273
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
LogRecordclass, 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]createdattribute 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.ConsoleOutputhad theset_levelmethod for changing the log level of the main logger class.ConsoleOutputis supposed to write to stdout/stderr directly and is thus unrelated to the logger.