Adding option to print logs during an api call#833
Conversation
openml/_api_calls.py
Outdated
|
|
||
| url = url.replace('=', '%3d') | ||
|
|
||
| logging.info('[%s] %s' % (request_method, url)) |
There was a problem hiding this comment.
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.
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.