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
+3
View File
@@ -39,6 +39,9 @@ contextBridge.exposeInMainWorld('metonaDesktop', {
removeAllListeners: (channel: string) => {
ipcRenderer.removeAllListeners(channel);
},
onMainLog: (callback: (data: { level: string; message: string; detail?: string }) => void) => {
ipcRenderer.on('main:log', (_: unknown, data: { level: string; message: string; detail?: string }) => callback(data));
},
workspace: {
getDir: () => ipcRenderer.invoke('workspace:getDir'),
setDir: (dir: string) => ipcRenderer.invoke('workspace:setDir', dir),