Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
.