Skip to content

mabel.logging.add_level

Justin Joyce edited this page Oct 24, 2021 · 3 revisions

report_suppressions (message)

add_logging_level (level_name, level_num, method_name)

Comprehensively adds a new logging level to the logging module and the currently configured logging class.

level_name becomes an attribute of the logging module with the value level_num. methodName becomes a convenience method for both logging itself and the class returned by logging.getLoggerClass() (usually just logging.Logger). If method_name is 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

This file has been automatically generated, it is not the truth. If in doubt the code will tell you unambiguously what it does.

Clone this wiki locally