How do you view error messages and console logs in Electron during development? Also, is it possible for the logs to be written directly into a file?
Edit: Kind of like the errors and console logs displayed by Chrome's dev tools: Except in Electron rather than Chrome.
On your BrowserWindow call the function
openDevTools()
this will open the same dev tools you find in Chrome. I wrote about this on my blog at http://www.mylifeforthecode.com/debugging-renderer-process-in-electron/.Here is a simple main.js file that includes openDevTools:
You can also access this via a renderer process using the remote module. For the apps I have been tinkering with I bind the function
toggleDevTools
to F12. Something like this:Note that I have only tested the above with Electron in Windows. I am assuming the Linux and Mac versions work the same. If you are running Mac or Linux please let me know if they do not.