From 1cd94e97050e2fd19c285fe96449b7561df7c87c Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 30 May 2026 20:01:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor(gui):=20=E5=88=A0=E9=99=A4=E5=B7=B2?= =?UTF-8?q?=E4=B8=8D=E7=94=A8=E7=9A=84=20logging/re/=5FLOGGER=20+=20RIGHT/?= =?UTF-8?q?Y=20=E5=B8=B8=E9=87=8F=20(183=20=E2=86=92=20178)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gui/gui_app.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gui/gui_app.py b/gui/gui_app.py index d98eed2..dcce39b 100644 --- a/gui/gui_app.py +++ b/gui/gui_app.py @@ -1,6 +1,4 @@ -import logging import os -import re import sys import warnings @@ -47,9 +45,6 @@ from gui.components.periodic_refreshers import ( warnings.filterwarnings("ignore", message=".*pin_memory.*", category=UserWarning) warnings.filterwarnings("ignore", message=".*accelerator.*", category=UserWarning) -# 模块级 logger:内部"日志写入失败 / pump_logs 异常"等错误统一走 logging -_LOGGER = logging.getLogger("gui.gui_app") - def format_gui_log_line(line: str) -> str: """将完整日志行转换为 GUI 显示用的精简版本。 @@ -73,9 +68,9 @@ def main(): import tkinter as tk from tkinter import ttk try: - from ttkbootstrap.constants import LEFT, RIGHT, BOTH, X, Y + from ttkbootstrap.constants import LEFT, BOTH, X except ImportError: - from tkinter.constants import LEFT, RIGHT, BOTH, X, Y # type: ignore[assignment] + from tkinter.constants import LEFT, BOTH, X # type: ignore[assignment] q, _log_writer, on_line, runner = setup_log_pipeline( format_gui_log_line=format_gui_log_line