Files
posefit-server/app/core/logging.py
T
wsy182 c8fd057129 Centralize configuration into config.yaml
- All settings moved to config.yaml
- configs/load.py reads from config.yaml with env var overrides
- Environment variables still work for backward compatibility
- Added pyyaml to requirements
2026-06-10 10:19:41 +08:00

21 lines
443 B
Python

from __future__ import annotations
from pathlib import Path
from loguru import logger
from configs.load import LOG_DIR, LOG_RETENTION, LOG_ROTATION
def setup_logging() -> None:
LOG_DIR.mkdir(parents=True, exist_ok=True)
logger.add(
LOG_DIR / "posefit-server_{time:YYYY-MM-DD}.log",
rotation=LOG_ROTATION,
retention=LOG_RETENTION,
enqueue=True,
backtrace=True,
diagnose=True,
)