Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main process IPC transport is not initialised #395

Closed
BTMorton opened this issue Jan 17, 2024 · 1 comment
Closed

Main process IPC transport is not initialised #395

BTMorton opened this issue Jan 17, 2024 · 1 comment

Comments

@BTMorton
Copy link

I've just updated to electron-log v5 and noticed that the main process logs aren't being forwarded to the renderer. I tried setting the log level as per the docs using:

log.transports.ipc.level  = 'silly';

but I get an undefined error:

TypeError: Cannot set properties of undefined (setting 'level')

I noticed that the IPC factory is not set when creating the default logger, so I tried manually instantiating the IPC transport explicitly and setting the level:

import * as ipcTransport from 'electron-log/src/main/transports/ipc';
...
log.transports.ipc = ipcTransport(log, log.dependencies);
log.transports.ipc.level  = 'silly';

which does forward the main process logs correctly, but also results in the renderer logs being printed twice. as the renderer logs are re-forwarded back to the renderer as a main process log.

I guess I have two questions:

  1. Is the IPC transport main -> renderer still supported or has there been a decision to deprecate it?
  2. How does the IPC forwarding of server logs work and is there something that can be done on my side to resolve the duplicate log issue?
@megahertz
Copy link
Owner

megahertz commented Jan 17, 2024

That will be fixed in v5.1, which I will release in 2-3 weeks. I think there's no way to fix that on your side before the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants