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

add callback to allow level change in debugger #4057

Merged
merged 2 commits into from Oct 28, 2022

Conversation

KedoKudo
Copy link
Contributor

The current debugger widget does not update the logging level once it is instantiated.
For example, the console created with the following code will always have its logging level set at given value:

import panel as pn
import param
import logging

pn.extension('terminal')

console = pn.widgets.Debugger(
            name="Console",
            level=logging.INFO,
            sizing_mode="stretch_width",
            logger_names=["panel", "imars3d"],
        )

console.level = logging.DEBUG   # <- this does not have any impact on the console widget due to missing callbacks

This PR adds a callback function that retrieve the stream and set the new log level for all tracking loggers.

@codecov
Copy link

codecov bot commented Oct 27, 2022

Codecov Report

Merging #4057 (830c1b4) into master (1647fa3) will decrease coverage by 0.11%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##           master    #4057      +/-   ##
==========================================
- Coverage   83.53%   83.42%   -0.12%     
==========================================
  Files         223      223              
  Lines       33219    33223       +4     
==========================================
- Hits        27751    27715      -36     
- Misses       5468     5508      +40     
Flag Coverage Δ
ui-tests 37.58% <60.00%> (+0.01%) ⬆️
unitexamples-tests 74.09% <75.00%> (-0.48%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
panel/widgets/debugger.py 92.42% <80.00%> (-0.55%) ⬇️
panel/models/quill.py 71.42% <0.00%> (-14.29%) ⬇️
panel/tests/pane/test_base.py 84.00% <0.00%> (-12.00%) ⬇️
panel/models/echarts.py 76.47% <0.00%> (-11.77%) ⬇️
panel/models/terminal.py 81.25% <0.00%> (-9.38%) ⬇️
panel/models/jsoneditor.py 75.00% <0.00%> (-9.38%) ⬇️
panel/tests/template/test_vanilla_manual.py 78.26% <0.00%> (-8.70%) ⬇️
panel/models/ace.py 83.33% <0.00%> (-8.34%) ⬇️
panel/tests/template/test_manual.py 57.57% <0.00%> (-4.05%) ⬇️
panel/tests/widgets/test_speech_to_text.py 88.65% <0.00%> (-2.07%) ⬇️
... and 10 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@philippjfr
Copy link
Member

Test failures are unrelated. Merging.

@philippjfr philippjfr merged commit 4d4cc99 into holoviz:master Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants