refactor: 使用 tracing 输出日志 (#1856)

* change all println to tracing
This commit is contained in:
Luna Yao
2026-03-04 02:52:23 +01:00
committed by GitHub
parent 1d25240d8c
commit 5f31583a84
18 changed files with 488 additions and 384 deletions
+5 -3
View File
@@ -4,6 +4,8 @@ use std::path::PathBuf;
use service_manager::ServiceManager as _;
use crate::common::log;
#[derive(Debug)]
pub struct ServiceInstallOptions {
pub program: PathBuf,
@@ -72,7 +74,7 @@ impl Service {
let kind = service_manager::ServiceManagerKind::native()?;
println!("service manager kind: {:?}", kind);
log::info!("service manager kind: {:?}", kind);
Ok(Self {
label: name.parse()?,
@@ -98,7 +100,7 @@ impl Service {
self.service_manager
.update(ctx)
.map_err(|e| anyhow::anyhow!("failed to update service: {:?}", e))?;
println!("Service updated successfully! Service Name: {}", self.label);
log::info!("Service updated successfully! Service Name: {}", self.label);
return Ok(());
}
@@ -106,7 +108,7 @@ impl Service {
.install(ctx)
.map_err(|e| anyhow::anyhow!("failed to install service: {:?}", e))?;
println!(
log::info!(
"Service installed successfully! Service Name: {}",
self.label
);