feat: improve log rule

This commit is contained in:
GyDi
2022-07-17 17:39:44 +08:00
parent 659fdd1d37
commit 4f6fceb87f
8 changed files with 33 additions and 33 deletions

View File

@@ -2,7 +2,6 @@ use super::{Clash, Verge};
use crate::{log_if_err, utils::sysopt::SysProxyConfig};
use anyhow::{bail, Result};
use auto_launch::{AutoLaunch, AutoLaunchBuilder};
// use parking_lot::Mutex;
use std::sync::Arc;
use tauri::{async_runtime::Mutex, utils::platform::current_exe};
@@ -46,7 +45,7 @@ impl Sysopt {
if enable {
if let Err(err) = sysproxy.set_sys() {
log::error!("failed to set system proxy for `{err}`");
log::error!(target: "app", "failed to set system proxy for `{err}`");
}
}
@@ -90,7 +89,7 @@ impl Sysopt {
if let Some(sysproxy) = self.old_sysproxy.take() {
match sysproxy.set_sys() {
Ok(_) => self.cur_sysproxy = None,
Err(_) => log::error!("failed to reset proxy"),
Err(_) => log::error!(target: "app", "failed to reset proxy"),
}
}
}
@@ -183,7 +182,7 @@ impl Sysopt {
break;
}
log::debug!("try to guard the system proxy");
log::debug!(target: "app", "try to guard the system proxy");
let clash = Clash::new();
@@ -194,7 +193,7 @@ impl Sysopt {
log_if_err!(sysproxy.set_sys());
}
None => log::error!("failed to parse clash port"),
None => log::error!(target: "app", "failed to parse clash port"),
}
}