MCPcopy Create free account
hub / github.com/StackStorm/st2 / LogLevelFilter

Class LogLevelFilter

st2client/st2client/utils/logging.py:27–40  ·  view source on GitHub ↗

Filter which excludes log messages which match the provided log levels.

Source from the content-addressed store, hash-verified

25
26
27class LogLevelFilter(logging.Filter):
28 """
29 Filter which excludes log messages which match the provided log levels.
30 """
31
32 def __init__(self, log_levels):
33 self._log_levels = log_levels
34
35 def filter(self, record):
36 level = record.levelno
37 if level in self._log_levels:
38 return False
39
40 return True
41
42
43def set_log_level_for_all_handlers(logger, level=logging.DEBUG):

Callers 1

setup_loggingFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected