-
Notifications
You must be signed in to change notification settings - Fork 13
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
Error In background Process #1
Comments
You can use IPC to send a message to the main process to log messages to it, e.g. via: Background window const electron = require('electron');
const ipcRenderer = electron.ipcRenderer;
let log = function(message) {
ipcRenderer.send('worker-message', message);
};
log('Hello world'); Main process ipcMain.on('worker-message', (e, message) => console.log(message)); You could also pipe it to the developer tools console of the main window via: Main process ipcMain.on('worker-message', function(e, message) {
mainWindow.webContents.send('worker-message', message);
}); Main window const electron = require('electron');
const ipcRenderer = electron.ipcRenderer;
ipcRenderer.on('worker-message', (event, message) => console.log(message)); You can also see this stack overflow topic for ways to write to stdout in the main process. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Console.log in background process not working. You can't see a single output out of it. How to debug it?
Is there a way to change stdout of this bakground process to main process stdout so that all console.log() of background process start show in main process console.
The text was updated successfully, but these errors were encountered: