Spaces:
Runtime error
Runtime error
File size: 327 Bytes
ddb4de0 c86f2b2 ddb4de0 c86f2b2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
"""
logger封装
"""
from loguru import logger
import sys
# 移除所有默认的处理器
logger.remove()
# 自定义格式并添加到标准输出
log_format = (
"<g>{time:MM-DD HH:mm:ss}</g> <lvl>{level:<9}</lvl>| {file}:{line} | {message}"
)
logger.add(sys.stdout, format=log_format, backtrace=True, diagnose=True)
|