2024年6月7日

Day24.日志命相关

摘要: 1.setting.py配置文件 """ logging配置,settings文件中的代码配置 """ import os os.chdir(os.path.dirname(os.path.abspath(__file__))) # 1、定义三种日志输出格式,日志中可能用到的格式化串如下 # %(n 阅读全文

posted @ 2024-06-07 17:50 与太阳肩并肩 阅读(3) 评论(0) 推荐(0) 编辑

Day24.日志字典的使用

摘要: 1.settings.py文件中的代码配置 1 """ 2 logging配置,settings文件中的代码配置 3 """ 4 5 import os 6 7 os.chdir(os.path.dirname(os.path.abspath(__file__))) 8 9 # 1、定义三种日志输出 阅读全文

posted @ 2024-06-07 16:36 与太阳肩并肩 阅读(5) 评论(0) 推荐(0) 编辑

Day24.日志格式与输出位置

摘要: 1.日志格式与输出位置_自定义时间格式输出 2.日志格式与输出位置_日志内容写入文件 3.日志格式与输出位置_loguru模块日志内容写入文件 阅读全文

posted @ 2024-06-07 13:58 与太阳肩并肩 阅读(5) 评论(0) 推荐(0) 编辑

Day24.日志级别

摘要: 1.日志级别_日志配置 # 一:日志配置 logging.basicConfig( # 1、日志输出位置:1、终端 2、文件 # filename='access.log', # 不指定,默认打印到终端 # 2、日志格式 format='%(asctime)s - %(name)s - %(leve 阅读全文

posted @ 2024-06-07 10:57 与太阳肩并肩 阅读(8) 评论(2) 推荐(0) 编辑

导航