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 @@