morpheus.utils.logger

Logging utilities for Morpheus

Functions

configure_logging(*extra_handlers[, ...]) 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(*extra_handlers, log_level=None, 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
*extra_handlers: List of handlers to add to existing default console and file handlers.

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, reason=None)[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_level

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

Previous morpheus.utils.loader_utils
Next morpheus.utils.logger.LogLevels
© Copyright 2024, NVIDIA. Last updated on Apr 11, 2024.