How to work with log console?

I’ve been using log console to see errors raised from inside of ipywidgets. Now I’m wondering how can I use it to print info messages (for debugging purposes). I’d like to print most of them only in log console, not notebook output. Messages would come from both ipywidgets and regular parts of code.

I’ve tried using basic logger from logging module and I suppose that my goal can be achieved by choosing right handler, but don’t know how to do it. Can anyone help? :slightly_smiling_face:

Are referring to the browser log window? E.g., Where the output of console.log ordinarily goes?

@adpatter from the context I guess this one:

Well, the log console was not originally intended for the user to log to it directly as discussed in Log Console ignores logging log level · Issue #9554 · jupyterlab/jupyterlab · GitHub. I think that it is an interesting use case for some applications, like when training a model when one may want to see the progress, but not necessarily have the long output stored in the notebook itself.

I don’t know if this is open to discussion (CC @jasongrout?) but if it is, someone would need to devise and contribute the Python-side integration (which could possibly reuse the existing kernel messages, as does ipywidgets) - I don’t believe it is currently available*.

*) as for how it works on my screenshot - it does not. The thing is that if if you set verbosity to “Info” you will get all outputs printed back at you in the log console.

Perhaps this is relevant: extension-examples/custom-log-console at master · jupyterlab/extension-examples · GitHub