-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Simple logging interface. #13275
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
Simple logging interface. #13275
Conversation
Thanks for the patch. Next time, I think it would be worth trying to contribute and collaborate to the other author's pull request before taking over. Github makes this super easy by either creating pull requests on someone's branch, or making suggestions. It would allow to give appropriate credit to everyone who worked on the feature and helps contributors feel valued. If collaborating on the original pull request is not possible for technical reasons, discussing and asking the original author prior to redoing the work would be nice. |
I would certainly not do this for a new contributor PR (except for long-dead PRs), and would be happy to credit @jklymak for the patch if he desires so (this is a general rule -- I'm not trying to game up my PR count (I could just split my mega-PRs into a bunch of smaller ones if I wanted to, to go back to a recent discussion...)). |
The point isn’t PR credit. It’s that I did spend some finite time on the original PR but hadn’t handled the reimplementation yet because so far as I could tell the discussion wasn’t over. It’s not a big deal, but we kind of do this for fun and having someone kick over your sandcastle and redo it for you is a bit off putting. |
My apologies for any hurt feelings. |
Concerning the content of the PR: I‘m still convinced that we shouldn‘t add handlers ourselves. By now, I wouldn’t even introduce any convenience helper functions. Using logging.basicConfig() is simple enough. Documenting this should be sufficient. However I acknowledge the idea behind the PR. And if a majority here decides that this philosophy is the way to go, I won’t object. But I’m not the one approving or merging this. |
doc/devel/contributing.rst
Outdated
more verbose than `logger.WARNING` in their code with the Matplotlib-provided | ||
helper:: | ||
|
||
matplotlib.set_loglevel("debug") |
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.
I think this should be plt.set_loglevel
. Most folks import pyplot, they don't always import matplotlib....
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.
done
I want a bit longer to think about this. |
doc/faq/troubleshooting_faq.rst
Outdated
(Standard functions from the `logging` module are also applicable; e.g. one | ||
could call ``logging.basicConfig(level="DEBUG")`` even before importing | ||
Matplotlib, or attach a custom handler to the "matplotlib" logger. This may | ||
be useful if you use a custom logging configuration.) |
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.
This needs a note as well that sometimes logging before the first import is necessary in order to get the startup information. i.e.
If debug information is needed during the initial Matplotlib imports, the logging module should be configured before the first Matplotlib import by adding "import logging; logging.basicConfig(level="DEBUG")" to the top of your script.
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.
Added that to the parenthetical note.
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.
Aside from the doc change. plt.set_loglevel
won't help with initial import problems.
54ccc5f
to
22edc4a
Compare
22edc4a
to
ac3db2e
Compare
rebased |
PR Summary
Small variant over #13129.
Handles the bug reported in #13264 (comment) as well.
PR Checklist