morpheus.utils.logger

Functions

configure_logging(log_level[, log_config_file])

Configures Morpheus logging in one of two ways.

deprecated_message_warning(logger, cls, new_cls)

Log a warning about a deprecated message

deprecated_stage_warning(logger, cls, name)

Log a warning about a deprecated stage

set_log_level(log_level)

Set the Morpheus logging level.

Classes

LogLevels(value)

An enumeration.

TqdmLoggingHandler([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 logging 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 logging 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.