From 518848b430a69775bd5bc479dfdf53fb248f2398 Mon Sep 17 00:00:00 2001 From: fusheng Date: Wed, 20 May 2026 20:21:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(core):=20=E5=B0=86=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA=E6=94=B9=E4=B8=BA=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E7=9A=84=E6=97=A5=E5=BF=97=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用 log::error 替换 eprintln! 进行错误日志记录 --- src/main.rs | 4 ++-- src/platform/mod.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6015173..35c5a1d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,11 +12,11 @@ use flexi_logger::{ fn main() { init_logger(); if let Err(e) = OmegaCode::run() { - eprintln!("Application error: {}", e); + error!("Application error: {}", e); // Print full error chain let mut current = e.source(); while let Some(cause) = current { - eprintln!("Caused by: {}", cause); + error!("Caused by: {}", cause); current = cause.source(); } std::process::exit(1); diff --git a/src/platform/mod.rs b/src/platform/mod.rs index f23be0d..4ca4191 100644 --- a/src/platform/mod.rs +++ b/src/platform/mod.rs @@ -36,7 +36,7 @@ macro_rules! app_dir { match $crate::platform::get_platform_app_dir() { Ok(dir) => dir, Err(e) => { - eprintln!("Failed to get app directory: {}", e); + error!("Failed to get app directory: {}", e); std::process::exit(1); } }