ghe_logger
Script to create the GHEtool logger for the console and the text file
- class GHEtool.logger.ghe_logger.CustomFormatter(fmt: str)
Bases:
Formatter
Class to create a special console coloring of the messages
- Parameters
- fmtstr
Format of the log message
- format(record: LogRecord) str
Formats the record.
- Parameters
- record: logging.LogRecord
record to be formatted
- Returns
- str
Formatted log message
- GHEtool.logger.ghe_logger.addLoggingLevel(levelName, levelNum, methodName=None)
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