The logging_handler module
- pyoma2.support.utils.logging_handler.configure_logging() Logger[source]
Configures and initializes logging for the pyOMA2 package.
The function sets up a root logger specifically for the package with a logging level determined by an environment variable. It also configures a console handler to output log messages with a specific format, including timestamp, logger name, log level, message, module, and line number. Optionally, this function can disable logging from the ‘matplotlib’ library based on an environment variable.
Environment Variables
- PYOMA_LOG_LEVELstr, optional
Defines the logging level for the pyOMA2 logger. Acceptable values include ‘DEBUG’, ‘INFO’, ‘WARNING’, ‘ERROR’, and ‘CRITICAL’. Defaults to ‘INFO’ if not specified.
- PYOMA_DISABLE_MATPLOTLIB_LOGGINGstr, optional
If set to ‘True’ or ‘1’, disables logging from the ‘matplotlib’ library. Defaults to ‘True’.
- returns:
The configured root logger for the pyOMA2 package.
- rtype:
logging.Logger
Notes
The logger’s name is set to ‘pyoma2’.
The logger outputs to the console.
The log format includes the timestamp, logger name, log level, message, and the module and line number where the log was generated.