simpm.log_cfg — SimPM’s Logging components
Configure logging for SimPM.
The module exposes a shared logger and the LogConfig helper
to tweak console/file logging for the simpm package.
Logging levels
logging.DEBUG= 10logging.INFO= 20logging.WARNING= 30logging.ERROR= 40logging.CRITICAL= 50
- simpm.log_cfg.logger = <Logger simpm (WARNING)>
Instances of the Logger class represent a single logging channel. A “logging channel” indicates an area of an application. Exactly how an “area” is defined is up to the application developer. Since an application can have any number of areas, logging channels are identified by a unique string. Application areas can be nested (e.g. an area of “input processing” might include sub-areas “read CSV files”, “read XLS files” and “read Gnumeric files”). To cater for this natural nesting, channel names are organized into a namespace hierarchy where levels are separated by periods, much like the Java or Python package namespace. So in the instance given above, channel names might be “input” for the upper level, and “input.csv”, “input.xls” and “input.gnu” for the sub-levels. There is no arbitrary limit to the depth of nesting.
- class simpm.log_cfg.LogConfig(enabled=False, console_level=10, file_level=10, file_path='simpm.log')
LogConfig is a class that allows developers to configure logging settings. It can be used to set parameters such as log output destination, log level, and log formatting. LogConfig provides a way to customize the logging behavior of an application based on specific requirements.
- enabled
This boolean property indicates whether the feature is enabled or disabled.