chore: 清除所有 console.log,主进程日志接入执行日志面板

This commit is contained in:
thzxx
2026-04-07 19:49:30 +08:00
parent d524339634
commit 34a6b9fd0b
5 changed files with 26 additions and 6 deletions
+6 -1
View File
@@ -26,7 +26,7 @@ import { setToolEnabled } from './services/tool-registry.js';
import { initToolConfirmModal } from './components/tool-confirm-modal.js';
import { initMemoryPanel } from './components/memory-panel.js';
import { initWorkspacePanel } from './components/workspace-panel.js';
import { initLogPanel } from './services/log-service.js';
import { initLogPanel, addLog } from './services/log-service.js';
import { logInfo, logSuccess, logError, logDebug, logInit, logWarn } from './services/log-service.js';
import type { ChatSession } from './types.js';
@@ -78,6 +78,11 @@ function setupDesktopIntegration(): void {
}
}) as EventListener);
// 主进程日志转发到日志面板
bridge.onMainLog((data: { level: string; message: string; detail?: string }) => {
addLog(data.level as any, data.message, data.detail);
});
// 退出时释放显存
bridge.onAppQuit(() => {
const api = state.get<OllamaAPI | null>(KEYS.API);