class documentation

class twisted.logger.LogLevelFilterPredicate: (source)

Implements interfaces: twisted.logger._filter.ILogFilterPredicate

View In Hierarchy

ILogFilterPredicate that filters out events with a log level lower than the log level for the event's namespace.

Events that not not have a log level or namespace are also dropped.

Method __init__
Instance Variable defaultLogLevel Undocumented
Method logLevelForNamespace Determine an appropriate log level for the given namespace.
Method setLogLevelForNamespace Sets the log level for a logging namespace.
Method clearLogLevels Clears all log levels to the default.
Method __call__ Undocumented
Instance Variable _logLevelsByNamespace Undocumented
def __init__(self, defaultLogLevel=LogLevel.info): (source)
ParametersdefaultLogLevelThe default minimum log level. (type: NamedConstant)
_logLevelsByNamespace = (source)

Undocumented

(type: Dict[str, NamedConstant])
defaultLogLevel = (source)

Undocumented

def logLevelForNamespace(self, namespace): (source)

Determine an appropriate log level for the given namespace.

This respects dots in namespaces; for example, if you have previously invoked setLogLevelForNamespace("mypackage", LogLevel.debug), then logLevelForNamespace("mypackage.subpackage") will return LogLevel.debug.

ParametersnamespaceA logging namespace. Use "" for the default namespace. (type: str)
ReturnsThe log level for the specified namespace. (type: NamedConstant)
def setLogLevelForNamespace(self, namespace, level): (source)

Sets the log level for a logging namespace.

ParametersnamespaceA logging namespace. (type: str)
levelThe log level for the given namespace. (type: NamedConstant)
def clearLogLevels(self): (source)

Clears all log levels to the default.

def __call__(self, event): (source)

Undocumented

ParameterseventUndocumented (type: LogEvent)
ReturnsUndocumented (type: NamedConstant)
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.