From fbaff3e90c361f96d4fdabde6984d9a29e1ddc87 Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Sat, 23 Aug 2025 00:28:39 +0800 Subject: [PATCH] fix: remove logLevel parameter from fetchLogsViaIPCPeriodically for consistency --- src/services/global-log-service.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/services/global-log-service.ts b/src/services/global-log-service.ts index 54e4a745..75495962 100644 --- a/src/services/global-log-service.ts +++ b/src/services/global-log-service.ts @@ -52,11 +52,9 @@ export const useGlobalLogStore = create((set) => ({ })); // IPC 日志获取函数 -export const fetchLogsViaIPCPeriodically = async ( - logLevel: LogLevel = "info", -) => { +export const fetchLogsViaIPCPeriodically = async () => { try { - const logs = await fetchLogsViaIPC(logLevel); + const logs = await fetchLogsViaIPC(); useGlobalLogStore.getState().setLogs(logs); console.log(`[GlobalLog-IPC] 成功获取 ${logs.length} 条日志`); } catch (error) { @@ -100,12 +98,12 @@ export const initGlobalLogService = ( startLogsStreaming(logLevel); // 立即获取一次日志 - fetchLogsViaIPCPeriodically(logLevel); + fetchLogsViaIPCPeriodically(); // 设置定期轮询来同步流式缓存的数据 clearIpcPolling(); ipcPollingInterval = setInterval(() => { - fetchLogsViaIPCPeriodically(logLevel); + fetchLogsViaIPCPeriodically(); }, 1000); // 每1秒同步一次流式缓存 // 设置连接状态 @@ -154,7 +152,7 @@ export const changeLogLevel = (level: LogLevel) => { if (enabled) { // IPC流式模式下重新启动监控 startLogsStreaming(level); - fetchLogsViaIPCPeriodically(level); + fetchLogsViaIPCPeriodically(); } };