NuRadioReco.utilities.logging module

NuRadioReco.utilities.logging.addLoggingLevel(levelName, levelNum, methodName=None)[source]

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

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

Notes

This function was taken from this answer

NuRadioReco.utilities.logging.setup_logger(name='NuRadioReco', level=None)[source]

Set up the parent logger which all module loggers should pass their logs on to. Any handler which was previously added to the logger is cleared, and a single new logging.StreamHandler() with a custom formatter is added. Next to this, an extra logging level STATUS is added with level=`LOGGING_STATUS`, which is defined in module.py (as of February 2024, its value is 25). Then STATUS is also set as the default logging level.

Parameters:
namestr, default=”NuRadioReco”

The name of the base logger

levelint, default=25

The logging level to use for the base logger