Utilities for logging framework.
Dictionary assigning color code to logging level.
Formatter class for logging module. It allows to predefine different format string used for some level ranges.
Parameters: |
|
---|
Overrides logging.LogRecord. It adds new attributes:
levelname_ - Name of level in lowercase.
- cseq - Escape sequence for terminal used to set color
assigned to particular log level.
- creset - Escape sequence for terminal used to reset foreground
color.
These can be used in format strings initializing logging formatters.
Accepts the same arguments as base class.
Computer color sequence for particular color code.
Returns: | Escape sequence for terminal used to set foreground color. |
---|---|
Return type: | str |
Convenience function for getting callable returning logger for particular module name. It’s supposed to be used at module’s level to assign its result to global variable like this:
from lmi.scripts import common
LOG = common.get_logger(__name__)
This can be used in module’s functions and classes like this:
def module_function(param):
LOG().debug("This is debug statement logging param: %s", param)
Thanks to LOG being a callable, it always returns valid logger object with current configuration, which may change overtime.
Parameters: | module_name (string) – Absolute dotted module path. |
---|---|
Return type: | logging.Logger |