Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot change log level #112

Closed
drammock opened this issue Oct 26, 2023 · 4 comments
Closed

Cannot change log level #112

drammock opened this issue Oct 26, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@drammock
Copy link

Description

This extension generates more than 100 lines of build output in my terminal, which makes it harder to find other output that I'm more interested in (e.g. sphinx warnings). I want to set the log level somehow, but can't figure out how. I have placed a jupyterlite_config.json in the same directory as conf.py and it's getting loaded:

[LiteBuildApp] Loaded config file: /opt/pydata-sphinx-theme/docs/jupyterlite_config.json

Here's the content of that file:

{
    "LiteBuildConfig": {
        "Application": {
            "log_level": 40
        }
    }
}

Inspired by this I also tried

{
    "LiteBuildConfig": {
        "log_level": 40
    }
}

but that gives a warning:

[LiteBuildApp] WARNING | Config option `log_level` not recognized by `LiteManager`.

Any guidance on how to actually suppress the terminal output of LiteBuildApp?

Reproduce

Sorry this is a complicated reproducer, I haven't had time to boil it down:

Expected behavior

the 100+ lines of output will be suppressed

Context

$ mamba list jupyterlite
# packages in environment at /opt/mambaforge/envs/pst:
#
# Name                    Version                   Build  Channel
jupyterlite-core          0.1.3              pyhd8ed1ab_0    conda-forge
jupyterlite-sphinx        0.9.3              pyhd8ed1ab_0    conda-forge
$ uname -a
Linux agelaius 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Browser: N/A, this is about terminal output during build

@drammock drammock added the bug Something isn't working label Oct 26, 2023
@drammock drammock changed the title config files not getting detected Cannot change log level Oct 26, 2023
@Carreau
Copy link
Collaborator

Carreau commented Jul 22, 2024

I believe this was taken care of by #153

@Carreau Carreau closed this as completed Jul 22, 2024
@steppi
Copy link
Collaborator

steppi commented Jul 22, 2024

I believe this was taken care of by #153

Right. @drammock, what we found is that jupyterlite has unprotected print statements and doesn't allow for setting a log level. The solution we came up with was to make it the default to silence all output from `jupyterlite`` but to offer an option to un-silence the output.

@agriyakhetarpal
Copy link
Member

@steppi, would it be a good idea to add a three-level (or less) logger and configure it? I feel it can be taken up in #162

@steppi
Copy link
Collaborator

steppi commented Jul 22, 2024

@steppi, would it be a good idea to add a three-level (or less) logger and configure it? I feel it can be taken up in #162

There's some prep work needed for that to actually help because the vast majority of noisy output comes upstream and can't be controlled with a logger.

Some of the output comes for doit from within jupyterlite_core, the verbosity is hard coded, and we'd need to get them to allow this to be configured. See jupyterlite/jupyterlite#1351.

Another source of noisy output is unguarded print statements in jupyterlite_core/addons/ as described in #149 (comment). These would need to be changed to use a logger.

If we actually want the log level to be configurable, this stuff needs to be changed upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants