shyft.dashboard.widgets.logger_box

Classes

LogLevel(value[, names, module, qualname, ...])

Enum with log levels from logging module

LoggerBox(doc, log_level[, width, height, ...])

Logger with test text box widget to show logs of test apps

class shyft.dashboard.widgets.logger_box.LogLevel(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Enum with log levels from logging module

CRITICAL = 50
ERROR = 40
WARNING = 30
INFO = 20
DEBUG = 10
NOTSET = 0
class shyft.dashboard.widgets.logger_box.LoggerBox(doc, log_level: int, width: int = 1600, height: int = 300, text_font_size: int = 10, text_font: str = 'monospace', enable_dark_scheme: bool = True, max_history: int = -1, long_class_name: bool = True)[source]

Bases: object

Logger with test text box widget to show logs of test apps

__init__(doc, log_level: int, width: int = 1600, height: int = 300, text_font_size: int = 10, text_font: str = 'monospace', enable_dark_scheme: bool = True, max_history: int = -1, long_class_name: bool = True)[source]

If used in bokeh async function without document lock, extra=dict(async_on=True) needs to be provided as kwargs in logging call.

Examples

self.logger.debug(“example msg”, extra=dict(async_on=True))

Parameters:
  • doc – Bokeh document

  • log_level – log level int, possible values [0, 10, 20, 30, 40, 50]

  • width – width of the logger box window

  • height – height of the logger box window

  • text_font_size – text font size of the log msg in the logger pox

  • text_font – type of the text font

  • enable_dark_scheme – use dark scheme for logger box window

  • max_history – number of items to keep in history, if -1 or 0 endless history is used

  • long_class_name – display the full class instance

get_class_from_frame(fr)[source]

This function tries to find the name of the class which function send the log msg

isEnabledFor(level)[source]

mimic python logging.logger.isEnabledFor

property layout_components

This property returns the layout components

callback_fontsize(attrn, old, text_font_size) None[source]

This function sets a new fontsize

callback_change_level(attrn, old, new)[source]

This function set the new log level

static calculate_item_height(text_font_size)[source]

Calculate the item height

update_data_source(msg: str = '')[source]

This function calculates and updates the position of all log msg, including the new msg if provided

display_msg(msg_level: str, name, msg, *args, **kwargs)[source]

This function calls the update function either for async or sync mode

debug(msg, *args, **kwargs)[source]

This function logs debug messages

info(msg, *args, **kwargs)[source]

This function logs info messages

error(msg, *args, **kwargs)[source]

This function logs error messages

exception(msg, *args, **kwargs)[source]

This function logs exception messages

critical(msg, *args, **kwargs)[source]

This function logs critical messages

warning(msg, *args, **kwargs)[source]

This function logs warning messages