devops.config.config_logging

Module for logging configuration.

Functions

parse_logging_config(raw_config)

Parse logging configuration from a raw dictionary.

set_logging_levels(config)

Set logging levels based on the provided LoggingConfig.

Classes

LoggingConfig([global_level, utils_level, ...])

Dataclass to hold logging configuration values.

class devops.config.config_logging.LoggingConfig(global_level=LogLevel.INFO, utils_level=LogLevel.INFO, config_level=LogLevel.INFO, cpp_level=LogLevel.INFO)[source]

Bases: object

Dataclass to hold logging configuration values.

Parameters:
global_level: LogLevel = 'INFO'
utils_level: LogLevel = 'INFO'
config_level: LogLevel = 'INFO'
cpp_level: LogLevel = 'INFO'
to_toml_lines()[source]

Convert the LoggingConfig to TOML lines.

Returns:

list[str] – The list of TOML lines representing the configuration.

Return type:

list[str]

devops.config.config_logging.parse_logging_config(raw_config)[source]

Parse logging configuration from a raw dictionary.

As a side effect, this function sets the logging levels according to the parsed configuration.

Parameters:

raw_config (dict) – The raw logging configuration dictionary.

Returns:

LoggingConfig – The parsed LoggingConfig dataclass instance.

Return type:

LoggingConfig

devops.config.config_logging.set_logging_levels(config)[source]

Set logging levels based on the provided LoggingConfig.

Parameters:

config (LoggingConfig) – The logging configuration.

Return type:

None