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]¶
-
A
QWidgetto displayloggingmessages.- Parameters:
level (
intorstr, optional) – The Logging Level to use to display theLogRecord.fmt (
str, optional) – The LogRecord attributes to use to display theLogRecord.datefmt (
strorNone, optional) – The strftime format to use for the time stamp. IfNonethen theISO8601date format is used,YYYY-mm-dd HH:MM:SS,sss.logger (
logging.Logger, optional) – Thelogging.Loggerto add thislogging.Handlerto. IfNonethe uses the rootlogging.Logger.parent (
QtWidgets.QWidget, optional) – The parent widget.
Example
To view an example of the
Loggerwidget run:>>> from msl.examples.qt import logger >>> logger.show()
- 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) – AllLogRecord’s with a Logging Level >= level will be saved.