From f2cd77ab0bfe783310b95968ad38c2289fdb7a07 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 3 Jan 2026 03:37:41 +0800 Subject: [PATCH] =?UTF-8?q?feat(logging):=20=E6=B7=BB=E5=8A=A0=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E9=85=8D=E7=BD=AE=E4=B8=AD=E7=9A=84=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=E4=BB=A5=E7=A1=AE=E4=BF=9D=E6=89=80=E6=9C=89=E5=88=86?= =?UTF-8?q?=E6=94=AF=E5=8F=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- douyin/logging/douyin_logging.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/douyin/logging/douyin_logging.py b/douyin/logging/douyin_logging.py index be47264..a740774 100644 --- a/douyin/logging/douyin_logging.py +++ b/douyin/logging/douyin_logging.py @@ -491,6 +491,11 @@ def configure_logging( """ global _logging_configured + # rotation 相关默认值(函数级),确保在所有分支可用,避免可能的未赋值使用 + rotation_enabled = False + rotation_when = None + rotation_interval = 1 + # 从 config.json 读取配置 if ( log_level is None @@ -498,10 +503,6 @@ def configure_logging( or keep_days is None or use_dated_logs is None ): - # 预初始化 rotation 相关变量,避免静态分析报未定义 - rotation_enabled = False - rotation_when = None - rotation_interval = 1 try: import json