core
¶
Core module - business logic, models, and utilities.
ConfigurationError
¶
Bases: Exception
Raised when configuration loading or parsing fails.
Initialize the configuration error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
str
|
Error description |
required |
config_path
|
str | None
|
Path to the config file that caused the error |
None
|
Source code in src/core/core_config.py
load_config
¶
Load the configuration from a YAML file, resolve environment variables, and validate it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_path
|
str
|
Path to the configuration YAML file. |
required |
Returns:
| Type | Description |
|---|---|
AppConfig
|
Validated AppConfig Pydantic model with resolved env vars. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the config file does not exist. |
ValueError
|
If the configuration is invalid, the path is insecure, or env vars are missing. |
PermissionError
|
If the config file cannot be read. |
YAMLError
|
If there is an error parsing the YAML file. |
RuntimeError
|
For unexpected errors during additional validation steps. |
Source code in src/core/core_config.py
get_full_log_path
¶
Return the full log path by joining the base logs directory with the relative path.
Ensures the base directory and the log file's directory exist.
Source code in src/core/logger.py
get_loggers
¶
Create and return loggers with QueueHandler for non-blocking file logging.
Sets up multiple loggers with different purposes and a shared queue listener for efficient file I/O. Uses RichHandler for colorized console output.
Note
This function never raises exceptions. On setup failure, it returns fallback loggers with basic StreamHandler configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
AppConfig
|
Typed application configuration. |
required |
Returns:
| Type | Description |
|---|---|
Logger
|
Tuple of (console_logger, error_logger, analytics_logger, |
Logger
|
db_verify_logger, listener). Listener is |