Logging with levels to lab log console

I figured out that I could redirect print statements to the jupyter lab logging console via

import logging
logger = logging.getLogger()

but is there a way where I can log with levels and get that sent to the console? I want to write statements like:

logger.debug("shapes")
logger.error("yikes")

And currently not seeing them in console.

Thanks! (I :heart: the log console & want to exploit it as much as possible but am having trouble finding the docs).

1 Like

From what I can tell, looking at some of the code (https://github.com/jupyterlab/jupyterlab/blob/ac3ab8cbed744cbbaacf4871a7a9e152ef6c9086/packages/logconsole-extension/src/nboutput.ts#L32-L71) it will display any iopub messages with priority info. So if you do any normal outputs from Jupyter, (printing, IPython.core.display.display, etc) these will show up in the output widget?

Although @jasongrout would have more ideas probably…

What is the “jupyter lab logging console” and how do I turn it on? If I google it, this post is the first thing that comes up.

I can open it by right clicking in an open Jupyter Lab notebook and selecting “Show Log Console”.

Hi @Profile - saulshanabrook - Jupyter Community Forum I want to make the same use of log console. Can I ask how you get the split vision with the log console on your right. I only get this below and do not know how to move log console from the bottom. Thanks for any advice
Roberto
Jupylab