electron-log
electron-log copied to clipboard
The rendering process will print the logs of the main process twice, in the utilityProcess.on('message ') of Electorn
[Main Process]
this.utilityProcess.on('message', (message: any) => {
const { event, data } = message
switch (event) {
case 'LOG':
return console.log('[Socket]', ...data)
case 'ERROR':
return console.error('[Socket]', ...data)
}
})
[Renderer Process]
Finally, the hooks of 'electron-log/reducer' were blocked
logger.hooks.push((message) => {
if (message.variables.processType === 'main') {
return false
}
// do something ...
})
By default, a renderer process prints nothing from the utility process, as well as the main process.