Skip to content
Snippets Groups Projects
Unverified Commit 1abca761 authored by Michael Clark's avatar Michael Clark Committed by GitHub
Browse files

:electron: Making Electron server logs visible in devtools (#3219)

* add electron logging to main browser process console

* add logging

* removing old way

* release notes
parent 6a85f845
No related branches found
No related tags found
No related merge requests found
......@@ -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':
......
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 () {};
---
category: Maintenance
authors: [MikesGlitch]
---
Makinig Server logs visible in devtools on Electron
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment