nemo_automodel.components.loggers.log_utils
nemo_automodel.components.loggers.log_utils
Module Contents
Classes
Functions
Data
API
Bases: Formatter
Logging formatter that colorizes the level name and includes date/time.
The date is included via asctime with a default format of YYYY-MM-DD HH:MM:SS. Colors can be disabled by setting the NO_COLOR env var, or forced with FORCE_COLOR.
Bases: Filter
A logging filter that controls log output based on the process rank.
This filter allows log messages only for rank 0 by default.
Decide whether to log the provided record.
Parameters:
The log record to be evaluated.
Returns: bool
True if the log record should be logged, False otherwise.
Ensure the root logger has at least one StreamHandler with the given formatter.
If handlers already exist on the root logger, set their formatter to the provided formatter. Otherwise, create a StreamHandler, attach the formatter and RankFilter, and add it to the root logger.
Add a filter to the root logger and all existing loggers.
Parameters:
A logging filter instance or callable to add.
Logging filter to exclude messages from specific modules.
Parameters:
The logging record to check.
A list of module name prefixes to filter out.
Returns: bool
False if the record’s logger name starts with any of the specified
Set up logging level and filters for the application.
Configures the logging level based on arguments, environment variables, or defaults. Optionally adds filters to suppress messages from specific modules.
Logging Level Precedence:
- Env var
LOGGING_LEVEL logging_levelargument- Default:
logging.INFO
Also configures a colorized formatter that includes the date/time.