Logging config
logging_config
#
LoggingManager
#
Manages the configuration and initialization of a structured logger.
This class provides flexible options for configuring log levels, formats, and output destinations.
Examples:
Initialize with default settings: >>> manager = LoggingManager(name="mypackage") >>> logger = manager.get_logger() >>> logger.info("Info message")
Methods:
Name | Description |
---|---|
configure_logging |
Dynamically adjust logging settings. |
get_logger |
Retrieve the logger instance. |
Source code in src/imgtools/loggers/logging_config.py
base_logging_config
property
#
Create the basic logging configuration settings.
Returns:
Type | Description |
---|---|
dict
|
Base logging configuration. |
configure_logging
#
configure_logging(
level: str = imgtools.loggers.logging_config.DEFAULT_LOG_LEVEL,
) -> structlog.stdlib.BoundLogger
Dynamically adjust logging settings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
str
|
Set the log level. |
imgtools.loggers.logging_config.DEFAULT_LOG_LEVEL
|
Returns:
Type | Description |
---|---|
structlog.stdlib.BoundLogger
|
Updated logger instance. |
Source code in src/imgtools/loggers/logging_config.py
get_logger
#
Retrieve the logger instance.
Returns:
Type | Description |
---|---|
structlog.stdlib.BoundLogger
|
Configured logger instance. |