fix: can not filiter log level as expected

This commit is contained in:
Tunglies
2025-08-03 09:52:27 +08:00
parent 3eb2a5b3ef
commit d16c691c0f
10 changed files with 83 additions and 44 deletions

View File

@@ -2,6 +2,7 @@
import {
getClashLogs,
startLogsMonitoring,
stopLogsMonitoring,
clearLogs as clearLogsCmd,
} from "@/services/cmds";
import dayjs from "dayjs";
@@ -28,6 +29,16 @@ export const startLogsStreaming = async (logLevel: LogLevel = "info") => {
}
};
// Stop logs monitoring
export const stopLogsStreaming = async () => {
try {
await stopLogsMonitoring();
console.log("[IPC-LogService] Stopped logs monitoring");
} catch (error) {
console.error("[IPC-LogService] Failed to stop logs monitoring:", error);
}
};
// Fetch logs using IPC command (now from streaming cache)
export const fetchLogsViaIPC = async (
logLevel: LogLevel = "info",