morpheus.utils.logger
Functions
|
Configures Morpheus logging in one of two ways. |
|
Log a warning about a deprecated message |
|
Log a warning about a deprecated stage |
|
Set the Morpheus logging level. |
Classes
|
An enumeration. |
|
Console log handler used by Morpheus, provides colorized output and sends all logs at level ERROR and above to stderr, others to stdout. |
- configure_logging(log_level, log_config_file=None)[source]
Configures Morpheus logging in one of two ways. Either specifying a logging config file to load or a logging level which will use a default configuration. The default configuration outputs to both the console and a file. Sets up a logging producer/consumer that works well in multi-thread/process environments.
- Parameters
- log_level: int
- log_config_file: str, optional (default = None):
Specifies the log level and above to output. Must be one of the available levels in the
<a href="https://docs.python.org/3/library/logging.html#module-logging">logging</a>
module.Instructs Morpheus to configure logging via a config file. These config files can be complex and are outlined in the Python logging documentation. Will accept either a
.ini
file which will be loaded vialogging.config.fileConfig()
(See here) or a.json
file which will be loaded vialogging.config.dictConfig()
(See here). Defaults to None.
- deprecated_message_warning(logger, cls, new_cls)[source]
Log a warning about a deprecated message
- deprecated_stage_warning(logger, cls, name)[source]
Log a warning about a deprecated stage
- set_log_level(log_level)[source]
Set the Morpheus logging level. Also propagates the value to MRC’s logging system to keep the logging levels in sync
- Parameters
- log_levelint
One of the levels from the
<a href="https://docs.python.org/3/library/logging.html#module-logging">logging</a>
module. i.e.logging.DEBUG
,logging.INFO
,logging.WARN
,logging.ERROR
, etc.- Returns
- int
The previously set logging level