(Latest Version)

morpheus.utils.logger

Functions

<a href="#morpheus.utils.logger.configure_logging">configure_logging</a>(log_level[, log_config_file])

Configures Morpheus logging in one of two ways.

<a href="#morpheus.utils.logger.deprecated_message_warning">deprecated_message_warning</a>(logger, cls, new_cls)

Log a warning about a deprecated message

<a href="#morpheus.utils.logger.deprecated_stage_warning">deprecated_stage_warning</a>(logger, cls, name)

Log a warning about a deprecated stage

<a href="#morpheus.utils.logger.set_log_level">set_log_level</a>(log_level)

Set the Morpheus logging level.

Classes

<a href="morpheus.utils.logger.LogLevels.html#morpheus.utils.logger.LogLevels">LogLevels</a>(value)

An enumeration.

<a href="morpheus.utils.logger.TqdmLoggingHandler.html#morpheus.utils.logger.TqdmLoggingHandler">TqdmLoggingHandler</a>([level])

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

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.

log_config_file: str, optional (default = None):

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 via logging.config.fileConfig() (See here) or a .json file which will be loaded via logging.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

© Copyright 2023, NVIDIA. Last updated on Apr 11, 2023.