caosadvancedtools.webui_formatter module#

class caosadvancedtools.webui_formatter.WebUI_Formatter(*args, full_file=None, **kwargs)#

Bases: Formatter

allows to make logging to be nicely displayed in the WebUI

You can enable this as follows: logger = logging.getLogger(“<LoggerName>”) formatter = WebUI_Formatter(full_file=”path/to/file”) handler = logging.Handler() handler.setFormatter(formatter) logger.addHandler(handler)

format(record)#

Return the HTML formatted log record for display on a website.

This essentially wraps the text formatted by the parent class in html.

Parameters:

record

Raises:

RuntimeError – If the log level of the record is not supported. Supported log levels include logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, and logging.CRITICAL.

Returns:

The formatted log record.

Return type:

str