mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-02 21:12:13 +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:
@@ -1,12 +1,12 @@
|
||||
use crate::{
|
||||
config::{Config, IVerge},
|
||||
feat::create_local_backup_with_namer,
|
||||
logging,
|
||||
process::AsyncHandler,
|
||||
utils::{dirs::local_backup_dir, logging::Type},
|
||||
utils::dirs::local_backup_dir,
|
||||
};
|
||||
use anyhow::Result;
|
||||
use chrono::Local;
|
||||
use clash_verge_logging::{Type, logging};
|
||||
use once_cell::sync::OnceCell;
|
||||
use parking_lot::RwLock;
|
||||
use std::{
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
use crate::{
|
||||
config::Config,
|
||||
core::{handle, timer::Timer, tray::Tray},
|
||||
logging,
|
||||
process::AsyncHandler,
|
||||
utils::logging::Type,
|
||||
};
|
||||
|
||||
use crate::logging_error;
|
||||
use clash_verge_logging::{Type, logging, logging_error};
|
||||
|
||||
use crate::utils::window_manager::WindowManager;
|
||||
use anyhow::{Context as _, Result};
|
||||
|
||||
@@ -4,7 +4,8 @@ use signal_hook::{
|
||||
low_level,
|
||||
};
|
||||
|
||||
use crate::{feat, logging, logging_error, utils::logging::Type};
|
||||
use crate::feat;
|
||||
use clash_verge_logging::{Type, logging, logging_error};
|
||||
|
||||
pub fn register() {
|
||||
tauri::async_runtime::spawn(async {
|
||||
|
||||
@@ -8,7 +8,8 @@ use windows_sys::Win32::{
|
||||
},
|
||||
};
|
||||
|
||||
use crate::{core::handle, feat, logging, utils::logging::Type};
|
||||
use crate::{core::handle, feat};
|
||||
use clash_verge_logging::{Type, logging};
|
||||
|
||||
// code refer to:
|
||||
// global-hotkey (https://github.com/tauri-apps/global-hotkey)
|
||||
|
||||
Reference in New Issue
Block a user