-
Notifications
You must be signed in to change notification settings - Fork 10
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
Ensure logging messages don't reach the root logger #345
Conversation
DEBUG should only be used when, well, debugging, and is thus not useful to have on by default.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev_master #345 +/- ##
===========================================
Coverage 75.52% 75.53%
===========================================
Files 59 59
Lines 7870 7871 +1
===========================================
+ Hits 5944 5945 +1
Misses 1926 1926 ☔ View full report in Codecov by Sentry. |
There's a difference between the level of the |
It seems the (outdated but not yet removed) root logging call in the Anyway, I do understand what the purpose of DEBUG is and it was never my intent to display DEBUG level messages to the user by default! |
Co-authored-by: teutoburg <73600109+teutoburg@users.noreply.github.com>
Interesting, now the tests fail on the |
Maybe because the logging configuration is not (correctly) applied in the tests? I can attempt to fix it and then push to this PR if that's ok with you |
Now test_logs_warning_for_float_dtype() fails:
I think I don't understand how logging works... let me try to summarize:
Then there are two handlers that are attached to the top_logger
I don't understand how the Debug info gets into the notebook before this PR, nor why the test fails for this PR. By the way, I figured you understood what the levels are for; setting the Debug level was done long ago, not sure whether it was also visible in the past though. |
Yeah that's fine. I didn't expect this to be so involved; I thought it was just an outdated loglevel setting that we never got to change |
Everything seems to work as intended now I think. The notebooks etc do not show the debug information anymore. |
The output in the notebooks now looks identical to the output before #339 . I also verified that it is still possible to set the loglevel to DEBUG through ~/.scopesim_rc.yaml. I was a bit afraid that disabling the propagation would prevent that. Maybe when we setup nightly runs of the notebooks (and other tests, and bulk simulations), we could automatically generate diffs with the previous night, to catch unexpected problems. Shall we merge this? |
It was something I introduced in the recent logging changes. The previous setting was WARNING by default, which was also what Oliver complained about in #257. It worked fine (i.e., no DEBUG by default) when I tested it, but I didn't test the case that there might be a plain |
This was also useful in the scope of the tests, because 42a9ed8 now also fixes the huge log spam that was sometimes seen in the tests. |
Changed the title to more closely reflect what's actually going on 🙃 |
The notebook plugin for pytest has a feature that does something like that, it's on my TODO to investigate this anyway... |
DEBUG should only be used when, well, debugging, and is thus not useful to have on by default.