-
-
Notifications
You must be signed in to change notification settings - Fork 211
Adding option to print logs during an api call #833
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
Conversation
openml/_api_calls.py
Outdated
|
|
||
| url = url.replace('=', '%3d') | ||
|
|
||
| logging.info('[%s] %s' % (request_method, url)) |
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.
Hm, I think it would make a lot of sense if you also add a logging.info for when the call is done, which then also states how much time was spent in that function.
openml/_api_calls.py
Outdated
|
|
||
| url = url.replace('=', '%3d') | ||
|
|
||
| logging.info('[%s] %s' % (request_method, url)) |
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.
Please don't use % for string interpolation in logging, but pass the formatting arguments as regular arguments to the function as logging.info('[%s] %s', request_method, url). Then, they're only interpolated if the logging level requires the program to do so.
Codecov Report
@@ Coverage Diff @@
## develop #833 +/- ##
==========================================
Coverage ? 90.41%
==========================================
Files ? 37
Lines ? 5977
Branches ? 0
==========================================
Hits ? 5404
Misses ? 573
Partials ? 0
Continue to review full report at Codecov.
|
What does this PR implement/fix? Explain your changes.
Adds a
logger.infowhich can be used to track what is happening during wait times for a long api call.