nat.utils.log_utils#

Attributes#

Classes#

LogFilter

This class is used to filter log records based on a defined set of criteria.

Functions#

setup_logging(log_level)

Configure logging with the specified level

Module Contents#

LOG_FORMAT = '%(asctime)s - %(levelname)-8s - %(name)s:%(lineno)d - %(message)s'#
LOG_DATE_FORMAT = '%Y-%m-%d %H:%M:%S'#
class LogFilter(filter_criteria: list[str])#

Bases: logging.Filter

This class is used to filter log records based on a defined set of criteria.

Initialize a filter.

Initialize with the name of the logger which, together with its children, will have its events allowed through the filter. If no name is specified, allow every event.

_filter_criteria#
filter(record: logging.LogRecord)#

Evaluates whether a log record should be emitted based on the message content.

Returns:

False if the message content contains any of the filter criteria, True otherwise.

setup_logging(log_level: int)#

Configure logging with the specified level