electron: --enable-logging option does not consistently produce output on windows 8.1
- Electron version: 1.3.4
- Operating system: Windows 8.1 x64
Running electron with the --enable-logging option does not reliably actually show any logging when run on Windows 8.1. Occasionally it will log to the console as expected but the vast majority of the time when launching, it will instead spawn a new blank console window that remain empty for the duration of the application’s runtime.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 4
- Comments: 23 (5 by maintainers)
disclaimer - This is such a hack, copy %windir%\system32\cmd.exe to some other location. right click -> Properties and choose Compatibility tab. Run it for Windows 8
Presto - console messages!
Setting
ELECTRON_ENABLE_LOGGING=truedoes not work for me at all, it simply doesn’t log anything to the console, and using--enable-loggingyields the same results as the OP is describing. I tried setting the environment variable globally in windows, or setting it in the command line before executing the electron command, neither worked.To offer a cleaner alternative to @mporter-di method:
If you don’t want to muck about with
cmd.exe, it will suffice to set the compatibility mode for%AppData%\Roaming\npm\node_modules\electron\dist\electron.exeexecutable instead. Or, if you are running from the local package, the compatibility mode can be set on.\node_modules\electron\dist\electron.exeexecutable.Let’s face it, after 3 years this problem is unlikely to be fixed. But, perhaps, the workaround can be documented in official documentation? One can only hope.
This is deeply frustrating to me, can we please just reenable logging? This pretty thoroughly trolls new users who don’t understand why their
console.logstatements don’t show up and think that it’s brokenExperiencing this issue with: Windows 8.1, Electron v2.0.5 (shows Chromium v61.0.3163.100, Node v8.9.3, v8 v6.1.534.41 when I run
electronwith no args)After upgrading to 1.8.2 this seems to be broken for me as well.
--enable-logging electron ...,ELECTRON_ENABLE_LOGGING=true electron ...andapp.commandLine.appendSwitch('--enable-logging');all fail. I’m running Arch Linux.I am still experiencing the same issue. The difference for me is that I’m running Windows 10. Until now I spendt the whole day trying to figure out what the problem is, but I can’t get the console to output any console.log() statements.
One thing to note is that when I run my app with node, except for of course giving me an error, it does actually output the log to the console.
I hope this can be fixed easily, or maybe its just me being stupid and doing something wrong.
I’m experiencing the same issue here. --enable-logging worked for maybe 5 runs, and then all subsequent runs are opening 2-3 blank console windows. (I believe I’m running Electron 1.6.x on Windows 8.1.)
I’m a new electron user and as awesome as electron seems in other areas, I’ve probably sunk a few hours into trying to make console.log work… Not exactly a productive afternoon! Like someone else posted, this is a big detriment to the new-developer experience.
For the few times that it worked, I was also disappointed that it logged everything from main and from the browser (including those chrome logging prefixes)…