diff --git a/packages/desktop-electron/index.ts b/packages/desktop-electron/index.ts index c7d9df81290adf17abd33ffd83c74f091acf7dc7..d5767d200fc341d8f0d93a9f78ee9b08bab0dfb9 100644 --- a/packages/desktop-electron/index.ts +++ b/packages/desktop-electron/index.ts @@ -60,9 +60,21 @@ function createBackgroundProcess() { serverProcess = utilityProcess.fork( __dirname + '/server.js', ['--subprocess', app.getVersion()], - isDev ? { execArgv: ['--inspect'] } : undefined, + isDev ? { execArgv: ['--inspect'], stdio: 'pipe' } : { stdio: 'pipe' }, ); + serverProcess.stdout.on('data', (chunk: Buffer) => { + // Send the Server console.log messages to the main browser window + clientWin?.webContents.executeJavaScript(` + console.info('Server Log:', ${JSON.stringify(chunk.toString('utf8'))})`); + }); + + serverProcess.stderr.on('data', (chunk: Buffer) => { + // Send the Server console.error messages out to the main browser window + clientWin?.webContents.executeJavaScript(` + console.error('Server Log:', ${JSON.stringify(chunk.toString('utf8'))})`); + }); + serverProcess.on('message', msg => { switch (msg.type) { case 'captureEvent': diff --git a/packages/loot-core/src/platform/exceptions/index.electron.ts b/packages/loot-core/src/platform/exceptions/index.electron.ts index 95adc82959a5ec7bd7355a3dc1d92c991d43b04f..caeb9291726ecd5f7f086874c410a59afec3d87e 100644 --- a/packages/loot-core/src/platform/exceptions/index.electron.ts +++ b/packages/loot-core/src/platform/exceptions/index.electron.ts @@ -1,7 +1,7 @@ import type * as T from '.'; export const captureException: T.CaptureException = function (exc) { - console.log('[Exception]', exc); + console.error('[Exception]', exc); }; export const captureBreadcrumb: T.CaptureBreadcrumb = function () {}; diff --git a/upcoming-release-notes/3219.md b/upcoming-release-notes/3219.md new file mode 100644 index 0000000000000000000000000000000000000000..4c73e3a5fc9592c2259b7fd3e6f04b5d13d23a8e --- /dev/null +++ b/upcoming-release-notes/3219.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [MikesGlitch] +--- + +Makinig Server logs visible in devtools on Electron