-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Show DeprecationWarnings as INFO messages #2907
Conversation
(previously they were not shown at all) This works for both extensions and plugins -- and for MkDocs itself. It will enable plugin developers to see warnings in advance. Or users to report such warnings to plugin developers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, I find that very elegant
Just to understand: the change basically makes sure warnings are shown to the user by logging them as INFO? If users already have warnings shown, will they see them twice (once as a regular warning and a second time as an info log)? Also, good call on making them INFO level and not WARNING 👍 |
There are 2 mechanisms at play here, both of them configured totally separately and both of them affected by this PR:
|
Thanks, that answers my questions :) perfect. |
Actually I'm not sure if hiding regular warnings in favor of INFO logs is a good idea. I mean, maybe keeping the duplication would be better. In the common case, that's a few more lines of INFO logs few will read, in the worst case, users that were relying on regular warnings don't get their pytest run fail anymore, and I believe that's less chance these users will report these deprecations to the upstream packages. I hope I'm wrong though. The INFO logs are pretty visible so I guess it's fine. |
Why would that happen? This affects only full runs of mkdocs
How is printing the exact same message twice better? There is no possible case where only one of them would kick in - it's either 2 or 0. |
Well, Other than that, there's no difference, both are just text in stderr |
Hmmm yeah I don't think a lot of users/plugin developers run MkDocs commands through pytest with warnings enabled anyway 🤔 |
(previously they were not shown at all)
This works for both extensions and plugins -- and for MkDocs itself.
It will enable plugin developers to see warnings in advance. Or users to report such warnings to plugin developers.
Ref #2892, Python-Markdown/markdown#1277
Example session:
cc @ultrabug @pawamoy