Closed gabrielmontagne closed 5 years ago
Unfortunately I don't know. There isn't much going on in electron-starter.js
, so I haven't had to do much with it, such as logging.
I've seen various discussions about logging and the main process; if you google 'electron main console.log' you can find various discussions on this. The use of create-react-app
(it's dev server) might also be getting in the way.
You might try packages like electron-log, which could be used to capture/direct logging. (I haven't used it, but came across it when I tried to do a quick search for a way to set the console.log
messages.
Here's what you need to do if you want to print the child process logs
const electron = exec("yarn electron");
electron.stdout.on("data", function(data) {
console.log("stdout: " + data.toString());
});
in electron-starter.js
Actually I just made a PR to fix this issue.
Seems to work. I accepted/merged the PR. Thanks
Perhaps because it's run as a child process, logs in the
electron-starter
are not shown on the console from which the project is started.As a workaround I am manually starting first the create react app bit, then, by hand, the electron npm script -- with the
ELECTRON_START_URL
prefix.Is there a way for this solution to surface
console.log
s from thatelectron-starter.
js file?Thanks!