loguru —— 日志记录
import os
from loguru import logger
# 日志设置
dir_log = "logs"
path_log = os.path.join(dir_log, '日志文件.log')
# 路径,每日分割时间,是否异步记录,日志是否序列化,编码格式,最长保存日志时间
logger.add(path_log, rotation= "90 MB", enqueue=True, serialize=False, encoding="utf-8", retention="10 days")