From d42708f1ae2fe6606c83105194286e0a8956ff4c Mon Sep 17 00:00:00 2001 From: wangle Date: Fri, 25 Oct 2024 22:11:42 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=B0=86=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E8=AF=AD=E5=8F=A5=E6=9B=BF=E6=8D=A2=E4=B8=BA=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用 log::info! 宏替换 println! 宏,以统一日志输出格式 --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index d4740d65..5f640fbf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -63,8 +63,8 @@ async fn main() -> Result<(), Box> { if let Some(cmd) = cli_opt.command { return run_subcommand(cmd).await; } - println!("version:{}, RUST_LOG:{}", get_app_version(), &rust_log); - println!("data dir:{}", sys_config.local_db_dir); + log::info!("version:{}, RUST_LOG:{}", get_app_version(), &rust_log); + log::info!("data dir:{}", sys_config.local_db_dir); let factory_data = config_factory(sys_config.clone()).await?; let app_data = build_share_data(factory_data.clone())?; let http_addr = sys_config.get_http_addr(); @@ -125,7 +125,7 @@ async fn main() -> Result<(), Box> { if let Some(num) = sys_config.http_workers { server = server.workers(num); } - println!("rnacos started"); + log::info!("rnacos started"); server.bind(http_addr)?.run().await?; Ok(()) }