This commit is contained in:
Dobromir Popov
2025-06-24 16:56:02 +03:00
parent 77a96030ba
commit 0c4dc8269c
2 changed files with 19 additions and 3 deletions

View File

@ -1,9 +1,7 @@
"""
Central Configuration Management Central Configuration Management
This module handles all configuration for the trading system. This module handles all configuration for the trading system.
It loads settings from config.yaml and provides easy access to all components. It loads settings from config.yaml and provides easy access to all components.
"""
import os import os
import yaml import yaml
@ -236,6 +234,15 @@ def get_config(config_path: str = "config.yaml") -> Config:
_config_instance = Config(config_path) _config_instance = Config(config_path)
return _config_instance return _config_instance
def load_config(config_path: str = "config.yaml") -> Dict[str, Any]:
"""Load configuration from YAML file"""
try:
config = get_config(config_path)
return config._config
except Exception as e:
logger.error(f"Error loading configuration: {e}")
return {}
def setup_logging(config: Optional[Config] = None): def setup_logging(config: Optional[Config] = None):
"""Setup logging based on configuration""" """Setup logging based on configuration"""
if config is None: if config is None:
@ -258,3 +265,12 @@ def setup_logging(config: Optional[Config] = None):
) )
logger.info("Logging configured successfully") logger.info("Logging configured successfully")
def load_config(config_path: str = "config.yaml") -> Dict[str, Any]:
"""Load configuration from YAML file"""
try:
config = get_config(config_path)
return config._config
except Exception as e:
logger.error(f"Error loading configuration: {e}")
return {}

Binary file not shown.