"""
sink 日志保存地方
level 发送到接收器的最低严重级别
级别 值 方法
TRACE 5 logger.trace()
DEBUG 10 logger.debug()
INFO 20 logger.info()
SUCCESS 25 logger.success()
WARNING 30 logger.warning()
ERROR 40 logger.error()
CRITICAL 50 logger.critical()
format 格式化模版
Key 官方描述 备注
elapsed The time elapsed since the start of the program 日期
exception The formatted exception if any, none otherwise
extra The dict of attributes bound by the user (see bind())
file The file where the logging call was made 出错文件
function The function from which the logging call was made 出错方法
level The severity used to log the message 日志级别
line The line number in the source code 行数
message The logged message (not yet formatted) 信息
module The module where the logging call was made 模块
name The __name__ where the logging call was made __name__
process The process in which the logging call was made 进程id或者进程名,默认是id
thread The thre
python loguru 日志模块
于 2022-03-08 15:21:07 首次发布
本文深入探讨了Python中用于日志记录的Loguru库,它提供了一种简洁而强大的方式来管理和定制应用程序的日志输出。通过Loguru,你可以轻松地设置日志级别、添加文件输出、自定义格式以及处理异常。无论你是初学者还是经验丰富的开发者,Loguru都能让你的日志管理工作变得更简单。
摘要由CSDN通过智能技术生成