From 8f55da19407f56a47324869a90ec4e89138c58d7 Mon Sep 17 00:00:00 2001 From: Julian Freeman Date: Sat, 14 Mar 2026 22:57:42 -0400 Subject: [PATCH] minimize log --- src-tauri/src/lib.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 417f819..c37b300 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -36,7 +36,6 @@ pub fn emit_log(handle: &AppHandle, id: &str, command: &str, output: &str, statu #[tauri::command] async fn initialize_app(app: AppHandle) -> Result { - // 统一由前端触发环境初始化 tokio::task::spawn_blocking(move || { ensure_winget_dependencies(&app).map(|_| true) }).await.unwrap_or(Err("Initialization Task Panicked".to_string())) @@ -116,9 +115,6 @@ pub fn run() { let (tx, mut rx) = mpsc::channel::(100); app.manage(AppState { install_tx: tx }); - // 移除了 setup 钩子中的 redundancy initialize_app 调用 - - // 安装队列处理器 tauri::async_runtime::spawn(async move { let perc_re = Regex::new(r"(\d+)\s*%").unwrap(); let size_re = Regex::new(r"([\d\.]+)\s*[a-zA-Z]+\s*/\s*([\d\.]+)\s*[a-zA-Z]+").unwrap(); @@ -183,7 +179,8 @@ pub fn run() { } } - if !is_progress { + // 净化日志:过滤进度行、单字符动画行以及退格符 + if !is_progress && clean_line.chars().count() > 1 { emit_log(&h, &log_id, "", clean_line, "info"); } }