scenario.logfilters module¶
Log filtering.
- class LoggerLogFilter¶
Bases:
FilterLog filter attached to a
Loggerinstance.Filters log records depending on the log level and the associated logger configuration.
- filter(record)¶
Filtering hook implementation.
- Parameters:
record – Log record to check for filtering.
- Returns:
See
logging.Filter.filter(): “Is the specified record to be logged? Returns 0 for no, nonzero for yes.”Nevertheless, we can see from the code that booleans are actually returned.
Checks whether the log record should be filtered out due to the attached
Loggerconfiguration.
- class HandlerLogFilter¶
Bases:
FilterLog filter attached to a
logging.Handlerinstance.Filters log records depending on scenario configurations:
ScenarioConfig.Key.LOG_CONSOLEandScenarioConfig.Key.LOG_FILE.- __init__(handler)¶
- Parameters:
handler – Attached
logging.Handler.
- _handler¶
Attached
logging.Handler.
- filter(record)¶
Filtering hook implementation.
- Parameters:
record – Log record to check for filtering.
- Returns:
See
logging.Filter.filter(): “Is the specified record to be logged? Returns 0 for no, nonzero for yes.”Nevertheless, we can see from the code that booleans are actually returned.
Checks the
ScenarioConfig.Key.LOG_CONSOLEorScenarioConfig.Key.LOG_FILEconfigurations, depending on the handler attached.