Skip to content

logger: log deprecation messages as warnings #4785

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

Merged
merged 1 commit into from
Aug 30, 2022

Conversation

bastimeyer
Copy link
Member

Deprecation messages should consistently get logged as warnings, to make them distinguishable from regular log messages, and to make it clear that user interactions are required.

While changing the log message channel, I experimented with switching to the warnings module and emitting DeprecationWarnings via warnings.warn() instead, but that would require capturing warnings in Streamlink's root logger, default warning filters would need to be changed (which I'm not sure how it would affect third party code), and in order to show warnings in a meaningful way for end-users, the resulting LogRecords would need to get changed as well. This is not worth the effort for using the deprecation warnings API of the stdlib.

@gravyboat gravyboat merged commit f020259 into streamlink:master Aug 30, 2022
@bastimeyer bastimeyer deleted the logger/deprecation-warnings branch August 30, 2022 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants