# How to work with log console?

**URL:** <https://discourse.jupyter.org/t/how-to-work-with-log-console/11548>\
**Category:** JupyterLab\
**Tags:** how-to, help-wanted\
**Created:** [November 4, 2021, 2:05pm UTC](https://discourse.jupyter.org/t/how-to-work-with-log-console/11548 "2021-11-04T14:05:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brzoskwina](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/brzoskwina/32/5630_2.png) [@Brzoskwina](https://discourse.jupyter.org/u/Brzoskwina)\
**Post date:** [November 4, 2021, 2:05pm UTC](https://discourse.jupyter.org/t/how-to-work-with-log-console/11548/1 "2021-11-04T14:05:00Z")

</div>

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? 🙂

---

<div class="post-metadata">

**Author:** ![adpatter](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/adpatter/32/21229_2.png) [@adpatter](https://discourse.jupyter.org/u/adpatter)\
**Post date:** [November 5, 2021, 5:29pm UTC](https://discourse.jupyter.org/t/how-to-work-with-log-console/11548/2 "2021-11-05T17:29:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [November 5, 2021, 10:18pm UTC](https://discourse.jupyter.org/t/how-to-work-with-log-console/11548/3 "2021-11-05T22:18:34Z")

</div>

@adpatter from the context I guess this one:

 ![Screenshot from 2021-11-05 22-15-51](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/f/fc2f6ab86126f51849afb7b79fb5242893ef278a.png)

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](https://github.com/jupyterlab/jupyterlab/issues/9554). 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.

---

<div class="post-metadata">

**Author:** ![adpatter](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/adpatter/32/21229_2.png) [@adpatter](https://discourse.jupyter.org/u/adpatter)\
**Post date:** [November 5, 2021, 10:30pm UTC](https://discourse.jupyter.org/t/how-to-work-with-log-console/11548/4 "2021-11-05T22:30:57Z")

</div>

Perhaps this is relevant: [extension-examples/custom-log-console at master · jupyterlab/extension-examples · GitHub](https://github.com/jupyterlab/extension-examples/tree/master/custom-log-console)
