From efa67c3e6710821647de3b7614730bed014c3b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=96=B5?= Date: Tue, 30 Jun 2026 16:19:51 +0800 Subject: [PATCH] =?UTF-8?q?2026.6.30=E5=B0=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run_mission.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/run_mission.py b/run_mission.py index f630bc8..3a20a10 100644 --- a/run_mission.py +++ b/run_mission.py @@ -791,12 +791,16 @@ def main(): # 创建日志目录 os.makedirs("./log", exist_ok=True) + # 生成带时间戳的日志文件名(精确到秒) + log_timestamp = time.strftime("%Y%m%d_%H%M%S") + log_file_path = f"./log/mission_run_{log_timestamp}.log" + logging.basicConfig( level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", handlers=[ - logging.StreamHandler(), - logging.FileHandler("./log/mission_run.log", mode="w"), + logging.StreamHandler(), # 终端输出(保留) + logging.FileHandler(log_file_path, mode="w"), # 每次新建,覆盖写入 ], )