class documentation

class LogFilter(logging.Filter):

Constructor: LogFilter(sources)

View In Hierarchy

Filter for the logging system. It removes all log messages that originate from the given sources.

Method __init__ Initialize the filter with the given sources. If the sources are empty, no filtering is done.
Method filter Filter out log messages from the given sources.
Instance Variable sources Tuple of sources to filter out. If empty, no filtering is done.
def __init__(self, sources: tuple[str, ...]):

Initialize the filter with the given sources. If the sources are empty, no filtering is done.

Parameters
sources:tuple[str, ...]A tuple of sources to filter out.
def filter(self, record: LogRecord) -> bool:

Filter out log messages from the given sources.

Parameters
record:LogRecordThe log record to filter.
Returns
boolTrue if the record should be logged, False otherwise.
sources =

Tuple of sources to filter out. If empty, no filtering is done.