前置 Loguru 集成配置 关键代码 import os import sys from loguru import logger work_path = os.path.split(os.path.realpath(__file__))[0] logs_path = os.path.join(work_path, "./logs") def logging_init(): # 确保日志目录存在 os.makedirs(logs_path, exist_ok=True) # 移除默认的logger logger.…