question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The logs in jupyter are too verbose + notebook is not trusted after black / reload

See original GitHub issue

Here is an short extract of the logs of my jupyter lab:

[I 2021-05-30 22:03:35.450 ServerApp] Saving file at /Fibonacci.py
[I 2021-05-30 22:03:35.451 ServerApp] Loading Jupytext configuration file at /.jupytext.toml
[I 2021-05-30 22:03:35.455 ServerApp] Saving Fibonacci.ipynb
[I 2021-05-30 22:03:35.509 ServerApp] Saving Fibonacci.py in format py:percent
[I 2021-05-30 22:03:36.338 ServerApp] Loading Jupytext configuration file at /.jupytext.toml
[I 2021-05-30 22:03:36.364 ServerApp] Saving file at /Fibonacci.py
[I 2021-05-30 22:03:36.365 ServerApp] Loading Jupytext configuration file at /.jupytext.toml
[I 2021-05-30 22:03:36.369 ServerApp] Saving Fibonacci.ipynb
[I 2021-05-30 22:03:36.437 ServerApp] Saving Fibonacci.py in format py:percent
[I 2021-05-30 22:03:46.521 ServerApp] Loading Jupytext configuration file at /.jupytext.toml
[I 2021-05-30 22:03:51.393 ServerApp] Loading Jupytext configuration file at /.jupytext.toml
[I 2021-05-30 22:03:51.399 ServerApp] Reading OUTPUTS from Fibonacci.ipynb
[W 2021-05-30 22:03:51.401 ServerApp] Notebook Fibonacci.ipynb is not trusted
[I 2021-05-30 22:03:53.760 ServerApp] Loading Jupytext configuration file at /.jupytext.toml
[I 2021-05-30 22:03:53.768 ServerApp] Saving file at /Fibonacci.py
[I 2021-05-30 22:03:53.768 ServerApp] Loading Jupytext configuration file at /.jupytext.toml
[I 2021-05-30 22:03:53.769 ServerApp] Saving Fibonacci.ipynb
[W 2021-05-30 22:03:53.769 ServerApp] Notebook Fibonacci.ipynb is not trusted
[I 2021-05-30 22:03:53.779 ServerApp] Saving Fibonacci.py in format py:percent
[I 2021-05-30 22:04:03.838 ServerApp] Loading Jupytext configuration file at /.jupytext.toml
[I 2021-05-30 22:04:13.878 ServerApp] Loading Jupytext configuration file at /.jupytext.toml

I would prefer to have

  • less mentions of “Loading Jupytext configuration file at /.jupytext.toml”
  • less redundancy in logs when paired files are saved: in the below we have two lines /Fibonacci.py and Fibonacci.py but there is a single .py file
[I 2021-05-30 22:03:36.364 ServerApp] Saving file at /Fibonacci.py
[I 2021-05-30 22:03:36.365 ServerApp] Loading Jupytext configuration file at /.jupytext.toml
[I 2021-05-30 22:03:36.369 ServerApp] Saving Fibonacci.ipynb
[I 2021-05-30 22:03:36.437 ServerApp] Saving Fibonacci.py in format py:percent
  • And I’d prefer not to have this warning Notebook Fibonacci.ipynb is not trusted, that came after I ran black and reloaded the .py notebook.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mwoutscommented, Sep 27, 2021

Hi @weiji14 , a quick comment on the resolution for this issue… I decided to refresh the config only when a notebook is opened, saved, or when a new directory is listed - No more periodical updates, so much less logs. The difference with the previous behavior is only for listing directories, so I do not expect much impact on users (the updated config will be used anyway when they open a file).

0reactions
weiji14commented, Sep 20, 2021

Hmm, a 1 second cache seems too fast… I doubt configuration files change very often, maybe increase it to something like 5 minutes? I’m still thinking whether this could be logged at the debug-level instead. Or, if you prefer keeping it at the info-level, only print out the log message if the configuration file did change from last time (e.g. change the message from “Loading Jupytext config…” to “Loaded Jupytext config…”).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jupyter notebook not trusted - python - Stack Overflow
I think jupyter lab latest release 1) this popup never comes up and 2) you cannot chose Trust under the file menu. The...
Read more >
What to do when things go wrong - The Jupyter Notebook
Try disabling any browser extensions and/or any Jupyter extensions you have installed. Some internet security software can interfere with Jupyter.
Read more >
How to fix Kernel Error or broken Python in Jupyter Notebook
TL;DW BELOW! If you delete or upgrade your python version, you might get a Kernel Error when trying to use Jupyter Notebooks !...
Read more >
Building and Exporting Python Logs in Jupyter Notebooks
Logging in Python when running scripts from the command line is very well documented, but we need to start with the basics before...
Read more >
Troubleshooting in Python - Plotly
js rendering engine installed, and the way to do that depends on the environment in which you are rendering figures: Dash, Jupyter Lab...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found