Files
xian_algorithm_new/app/config/paths.py
T

24 lines
595 B
Python
Raw Normal View History

"""
项目配置模块
提供统一的项目路径和配置管理
"""
from pathlib import Path
# 项目根目录(app/config/ 的上两级)
PROJECT_ROOT = Path(__file__).parent.parent.parent
# 日志目录
LOG_DIR = PROJECT_ROOT / "logs"
# 配置文件目录
CONFIG_DIR = PROJECT_ROOT / "app" / "config"
# DBN 配置目录
DBN_CONFIG_DIR = CONFIG_DIR / "dbn"
def get_logger(name: str = "algorithm"):
2026-06-20 17:07:05 +08:00
"""获取日志记录器(loguru 不可用时自动回退标准 logging)"""
from app.utils.logger import LoggerManager
return LoggerManager.get_logger(name, str(LOG_DIR))