refactor(logger): replace ClashLogger with CLASH_LOGGER and update log handling; improve log retrieval and management

This commit is contained in:
Tunglies
2025-10-29 17:58:02 +08:00
parent 2e9f6dd174
commit f4de4738f1
8 changed files with 120 additions and 96 deletions

View File

@@ -1,7 +1,7 @@
use super::{CoreManager, RunningMode};
use crate::{
core::{
logger::ClashLogger,
logger::CLASH_LOGGER,
service::{SERVICE_MANAGER, ServiceStatus},
},
logging,
@@ -21,7 +21,7 @@ impl CoreManager {
}
pub async fn stop_core(&self) -> Result<()> {
ClashLogger::global().clear_logs();
CLASH_LOGGER.clear_logs().await;
match *self.get_running_mode() {
RunningMode::Service => self.stop_core_by_service().await,