c612a7ad71
- 移除了 config.yaml 中的注释行 - 移除了 app/core/logging.py 中多余的空格 - 移除了 app/main.py 中的环境变量设置代码 - 移除了 app/main.py 中未使用的导入语句
22 lines
457 B
Python
22 lines
457 B
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
from loguru import logger
|
|
|
|
from configs.load import config
|
|
|
|
|
|
def setup_logging() -> None:
|
|
log_dir = config.logging.dir_path
|
|
log_dir.mkdir(parents=True, exist_ok=True)
|
|
|
|
logger.add(
|
|
log_dir /"{time:YYYY-MM-DD}.log",
|
|
rotation=config.logging.rotation,
|
|
retention=config.logging.retention,
|
|
enqueue=True,
|
|
backtrace=True,
|
|
diagnose=True,
|
|
)
|