From 0e2ff7be6ede55bb2e50953553ff2b9a457a56db Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 7 Jan 2026 19:10:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=87=BD=E6=95=B0=E4=B8=AD=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A0=BC=E5=BC=8F=EF=BC=8C=E6=8F=90=E5=8D=87=E5=8F=AF?= =?UTF-8?q?=E8=AF=BB=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- douyin/logging/douyin_logging.py | 18 +++++------------- webui/index.html | 7 ++++++- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/douyin/logging/douyin_logging.py b/douyin/logging/douyin_logging.py index ab9bcf4..455624c 100644 --- a/douyin/logging/douyin_logging.py +++ b/douyin/logging/douyin_logging.py @@ -719,7 +719,8 @@ def configure_logging( try: # 计算当前日志总大小(MB) pattern = os.path.join( - log_dir or path_config.get_logs_dir(), f"{os.path.basename(base_filename_base)}_*.log*" + log_dir or path_config.get_logs_dir(), + f"{os.path.basename(base_filename_base)}_*.log*", ) total_size = 0 for p in glob.glob(pattern): @@ -741,7 +742,9 @@ def configure_logging( keep_days=keep_days, max_total_size_gb=max_total_size_gb, compress_after_days=compress_after_days, - compress=compress_logs if compress_logs is not None else True, + compress=( + compress_logs if compress_logs is not None else True + ), ) except Exception: pass @@ -749,22 +752,11 @@ def configure_logging( # 启动日志监控器 if enable_monitor: try: - # 从配置中读取是否允许运行时清理(默认为 False) - try: - enable_runtime_cleanup_cfg = False - if isinstance(log_config, dict): - enable_runtime_cleanup_cfg = bool( - log_config.get("enable_runtime_cleanup", False) - ) - except Exception: - enable_runtime_cleanup_cfg = False - start_log_monitor( logs_dir=log_dir or path_config.get_logs_dir(), base_name=os.path.basename(base_filename_base), warning_size_mb=monitor_warning_mb, critical_size_mb=monitor_critical_mb, - enable_runtime_cleanup=enable_runtime_cleanup_cfg, ) except Exception as e: try: diff --git a/webui/index.html b/webui/index.html index 0e8507b..d34f423 100644 --- a/webui/index.html +++ b/webui/index.html @@ -798,7 +798,12 @@
运行日志
- + + +