electron-log icon indicating copy to clipboard operation
electron-log copied to clipboard

The rendering process will print the logs of the main process twice, in the utilityProcess.on('message ') of Electorn

Open BukJiang opened this issue 6 months ago • 1 comments

[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 ...
})

BukJiang avatar Jun 25 '25 03:06 BukJiang

By default, a renderer process prints nothing from the utility process, as well as the main process.

megahertz avatar Jul 03 '25 10:07 megahertz