-
Notifications
You must be signed in to change notification settings - Fork 304
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
Consistent logging method #607
Consistent logging method #607
Conversation
Codecov Report
@@ Coverage Diff @@
## master #607 +/- ##
==========================================
- Coverage 77.42% 77.34% -0.09%
==========================================
Files 110 110
Lines 10252 10252
Branches 1258 1259 +1
==========================================
- Hits 7938 7929 -9
- Misses 1917 1927 +10
+ Partials 397 396 -1
Continue to review full report at Codecov.
|
I also did a quick check for any |
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.
LGTM @mwakaba2 - thank you.
Thanks! |
Problem
This closes #605
Two methods in the class
ZMQChannelsHandler
were using thelogging
function directly instead ofself.log
method to emit logs. We already have a default format set for all Jupyter server logs, so this PR updates the following methods' logging calls to keep the format consistent.on_kernel_restarted
on_restart_failed
Changes made
logging
with the instantiated class's own logging method:self.log
.log
parameter tolist_running_servers
to add missing warning log for failed server info file deletion.Tests
While trying to reproduce the logs with
logging
, I found out that logs emitted with thelogging
function weren't getting propagated.To reproduce the issue, I tested logging in the
ZMQChannelsHandler.on_iopub
method - code. (I didn't know how to reproduce/trigger calls toZMQChannelsHandler.<on_kernel_restarted, on_restart_failed>
). I replacedself.log
withlogging
.To emit the logs, I did the following:
jupyter server --ServerApp.log_level=DEBUG --ServerApp.jpserver_extensions='{"jupyterlab": True}'
The "IoPub received" log wasn't emitted.
[D 2021-11-06 10:15:34.214 ServerApp] !!!!!!!!!!! UPDATED LOGGING METHOD [D 2021-11-06 10:15:34.214 ServerApp] Nudge: resolving iopub future: e1b8b87c-4d10-4782-bad7-50e7cf1cf732 [D 2021-11-06 10:15:34.214 ServerApp] Nudge: shell info reply received: e1b8b87c-4d10-4782-bad7-50e7cf1cf732
With
self.log
, the logs are emitted:[D 2021-11-06 10:15:07.030 ServerApp] !!!!!!!!!!! UPDATED LOGGING METHOD [D 2021-11-06 10:15:07.030 ServerApp] Nudge: IOPub received: 1e48ec11-17c0-487b-bd53-f24bce96617a [D 2021-11-06 10:15:07.030 ServerApp] Nudge: resolving iopub future: 1e48ec11-17c0-487b-bd53-f24bce96617a [D 2021-11-06 10:15:07.031 ServerApp] Nudge: shell info reply received: 1e48ec11-17c0-487b-bd53-f24bce96617a
At some point, we may want to figure out a way to encourage usage of
self.log
instead oflogging
.