msl.qt.widgets.logger module

A QWidget to display logging messages.

class msl.qt.widgets.logger.Logger(*, level=20, fmt='%(asctime)s [%(levelname)s] -- %(name)s -- %(message)s', datefmt=None, logger=None, parent=None)[source]

Bases: Handler, QWidget

A QWidget to display logging messages.

Parameters:

Example

To view an example of the Logger widget run:

>>> from msl.examples.qt import logger  
>>> logger.show()  
property records

The history of all the log records.

Type:

list of LogRecord

save(path, *, level=20)[source]

Save log records to a file.

Parameters:
  • path (str) – The path to save the log records to. Appends the records to the file if the file already exists, otherwise creates a new log file. It is recommended that the file extension be .log, but not mandatory.

  • level (int, optional) – All LogRecord’s with a Logging Level >= level will be saved.