INNER CODE UNIT · Python
filter
br3ndonland/inboard · inboard/logging_conf.py:85
def filter(self, record: logging.LogRecord) -> bool:
"""Determine if the specified record is to be logged.
Returns True if the record should be logged, or False otherwise.
"""
if self.filters is None:
return True
message = record.getMessage()
return all(match not in message for match in self.filters)
@staticmethod
def set_filters(input_filters: str | None = None) -> set[str] | None:
"""Set log message filters.
Filters identify log messages to filter out, so that the logger does not
log messages containing any of the filters. The argument to this method
should be supplied as a comma-separated string. The string will be split
on commas and converted to a set of strings.