config
This commit is contained in:
@ -236,6 +236,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 +267,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 {}
|
||||||
|
Reference in New Issue
Block a user