add_logging_level¶
-
config.isf_logging.add_logging_level(levelName, levelNum, methodName=
None)¶ Comprehensively adds a new logging level to the
loggingmodule and the currently configured logging class.levelNamebecomes an attribute of theloggingmodule with the valuelevelNum. methodName becomes a convenience method for bothloggingitself and the class returned by logging.getLoggerClass() (usually justlogging.Logger). IfmethodNameis not specified,levelName.lower()is used.To avoid accidental clobberings of existing attributes, this method will raise an AttributeError if the level name is already an attribute of the logging module or if the method name is already present
Example
>>> addLoggingLevel('TRACE', logging.DEBUG - 5) >>> logging.getLogger(__name__).setLevel("TRACE") >>> logging.getLogger(__name__).trace('that worked') >>> logging.trace('so did this') >>> logging.TRACE 5
Documentation unclear, incomplete, broken or wrong? Let us know