loguru

2023-03-23  本文已影响0人  hehehehe
from loguru import logger
import os

basedir = os.path.dirname(os.path.abspath(__file__))

# 定位到log日志文件
log_path = os.path.join(basedir, './logs')

if not os.path.exists(log_path):
    os.mkdir(log_path)

logger.add(log_path + '/runtime_{time}.log', rotation='00:00', enqueue=True, retention='10 days')

上一篇 下一篇

猜你喜欢

热点阅读