I have a panel code using a debugger widget to display log messages as follows.
import logging
import panel as pn
pn.extension(
"terminal",
console_output="disable",
)
logger = logging.getLogger("panel.myapp_logging")
debug_info = pn.widgets.Debugger(
name="Debugger (logging)",
level=logging.DEBUG,
sizing_mode="stretch_both",
logger_names=["panel.myapp_logging"],
)
btn_info = pn.widgets.RadioButtonGroup(
name="show info",
options=["debug", "info", "warning"],
)
def throw_error(event):
msg = (event + " sent from btn_info to logging.logger()").capitalize()
if event == "info":
logger.info(msg)
elif event == "debug":
logger.debug(msg)
elif event == "warning":
logger.warning(msg)
return msg
logger.info("want to put this message to the debugger widget.")
pn.Column(
btn_info, debug_info, pn.bind(throw_error, btn_info), sizing_mode="stretch_both"
).servable()
When I run the code by, e.g., panel serve .app.py
, it does not display the log message “want to put this message to the debugger widget.”, while on_click messages such as “Info sent from btn_info to logging.logger()” are shown in the widget. I’m not sure it is expected behavior or not, but I’d expect to show all messages to the logger to the debugger widget. Do you have any ideas?