mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-14 14:52:08 +08:00
feat(logging): introduce clash-verge-logging crate for management (#5486)
* feat(logging): introduce clash-verge-logging crate for management - Added a new crate `clash-verge-logging` with dependencies on `log`, `tokio`, `compact_str`, and `flexi_logger`. - Implemented logging types and macros for structured logging across the application. - Replaced existing logging imports with the new `clash_verge_logging` crate in various modules. - Updated logging functionality to support different logging types and error handling. - Refactored code to improve logging consistency and maintainability. * fix(logging): update import paths for clash_verge_logging in linux.rs and dns.rs * fix(logging): update import statement for clash_verge_logging in windows.rs
This commit is contained in:
@@ -3,10 +3,10 @@ use crate::{
|
||||
config::{Config, ConfigType, IRuntime},
|
||||
constants::timing,
|
||||
core::{handle, validate::CoreConfigValidator},
|
||||
logging,
|
||||
utils::{dirs, help, logging::Type},
|
||||
utils::{dirs, help},
|
||||
};
|
||||
use anyhow::{Result, anyhow};
|
||||
use clash_verge_logging::{Type, logging};
|
||||
use smartstring::alias::String;
|
||||
use std::{path::PathBuf, time::Instant};
|
||||
use tauri_plugin_mihomo::Error as MihomoError;
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
use super::{CoreManager, RunningMode};
|
||||
use crate::cmd::StringifyErr as _;
|
||||
use crate::config::{Config, IVerge};
|
||||
use crate::{
|
||||
core::{
|
||||
logger::CLASH_LOGGER,
|
||||
service::{SERVICE_MANAGER, ServiceStatus},
|
||||
},
|
||||
logging,
|
||||
utils::logging::Type,
|
||||
use crate::core::{
|
||||
logger::CLASH_LOGGER,
|
||||
service::{SERVICE_MANAGER, ServiceStatus},
|
||||
};
|
||||
use anyhow::Result;
|
||||
use clash_verge_logging::{Type, logging};
|
||||
use smartstring::alias::String;
|
||||
|
||||
impl CoreManager {
|
||||
|
||||
@@ -5,13 +5,10 @@ use crate::{
|
||||
core::{handle, logger::CLASH_LOGGER, service},
|
||||
logging,
|
||||
process::CommandChildGuard,
|
||||
utils::{
|
||||
dirs,
|
||||
init::sidecar_writer,
|
||||
logging::{SharedWriter, Type, write_sidecar_log},
|
||||
},
|
||||
utils::{dirs, init::sidecar_writer},
|
||||
};
|
||||
use anyhow::Result;
|
||||
use clash_verge_logging::{SharedWriter, Type, write_sidecar_log};
|
||||
use compact_str::CompactString;
|
||||
use flexi_logger::DeferredNow;
|
||||
use log::Level;
|
||||
|
||||
Reference in New Issue
Block a user