shyft.dashboard.widgets.logger_box

Classes

LogLevel(*values)

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(*values)[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, width=1600, height=300, text_font_size=10, text_font='monospace', enable_dark_scheme=True, max_history=-1, long_class_name=True)[source]

Bases: object

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

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 (int) – log level int, possible values [0, 10, 20, 30, 40, 50]

  • width (int) – width of the logger box window

  • height (int) – height of the logger box window

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

  • text_font (str) – type of the text font

  • enable_dark_scheme (bool) – use dark scheme for logger box window

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

  • long_class_name (bool) – display the full class instance

__init__(doc, log_level, width=1600, height=300, text_font_size=10, text_font='monospace', enable_dark_scheme=True, max_history=-1, long_class_name=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 (int) – log level int, possible values [0, 10, 20, 30, 40, 50]

  • width (int) – width of the logger box window

  • height (int) – height of the logger box window

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

  • text_font (str) – type of the text font

  • enable_dark_scheme (bool) – use dark scheme for logger box window

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

  • long_class_name (bool) – 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)[source]

This function sets a new fontsize

Return type:

None

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='')[source]

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

Parameters:

msg (str)

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

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

Parameters:

msg_level (str)

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