-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Fix736 #861
Conversation
… sure the openml logger is used instead of the root logger.
I guess we should move to print then. Could you please change that? |
This looks good besides my (small comments). Could you please also add this to the changelog? |
Codecov Report
@@ Coverage Diff @@
## develop #861 +/- ##
===========================================
- Coverage 88.43% 88.38% -0.05%
===========================================
Files 37 37
Lines 4272 4298 +26
===========================================
+ Hits 3778 3799 +21
- Misses 494 499 +5
Continue to review full report at Codecov.
|
I know it wasn't part of my original requests, but what do you think about having an example in which we show how one can easily change the log level? That might be good for folks who do ML, but do not care too much about how logging works in python. |
Fixes #736.
logging.WARNING
and up are printed to console (by default). This is in line with old behavior.logging.DEBUG
and up (i.e. all of them) are logged to a file in the cache directory (by default). A new log file is created if the old log file reaches a size of 1 MB. At most one current log file and and old log file will be kept on disk at a time (i.e. at most 2 MB of openml-python logs are kept).file_verbosity
is introduced alongside the regularverbosity
.The difference can be seen when running the following lines of code:
in current
develop
we will see:printed in console, with no (semi-)permanent of the log is kept automatically.
With this PR, the console output becomes:
and in my cache directory I find a file 'openml_python.log' with the following content:
I don't know how to unit test this, if at all.
A note on examples. I noticed some examples use logging (run setup and the fanova example). The generated pages do not show any logging output, so I was wondering what the purpose for the logging is. Perhaps @janvanrijn can help me here, as he seems to be the author.