Logging

Logging support for varlord.

Provides configurable logging to track configuration loading, merging, and type conversion.

varlord.logging.get_logger()[source]

Get or create the varlord logger.

Returns:

Logger instance for varlord.

Return type:

Logger

varlord.logging.set_log_level(level)[source]

Set the logging level for varlord.

Parameters:

level (int) – Logging level (e.g., logging.DEBUG, logging.INFO)

varlord.logging.log_source_load(source_name, count)[source]

Log source loading.

Parameters:
  • source_name (str) – Name of the source

  • count (int) – Number of configuration items loaded

varlord.logging.log_merge(source_name, key, value)[source]

Log configuration merge.

Parameters:
  • source_name (str) – Name of the source

  • key (str) – Configuration key

  • value (Any) – Configuration value

varlord.logging.log_type_conversion(key, value, target_type, result)[source]

Log type conversion.

Parameters:
  • key (str) – Configuration key

  • value (Any) – Original value

  • target_type (type) – Target type

  • result (Any) – Converted value

varlord.logging.log_validation_error(key, value, error)[source]

Log validation error.

Parameters:
  • key (str) – Configuration key

  • value (Any) – Invalid value

  • error (str) – Error message

varlord.logging.log_config_loaded(model_name, keys)[source]

Log successful configuration load.

Parameters:
  • model_name (str) – Name of the configuration model

  • keys (list[str]) – List of loaded configuration keys

varlord.logging.log_error(message, exc=None)[source]

Log error.

Parameters:
  • message (str) – Error message

  • exc (Exception | None) – Optional exception