nat.utils.log_utils#

Classes#

LogFilter

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

Module Contents#

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.