electron-log
electron-log copied to clipboard
Environment variable for log.transports.console.level?
I'm using Mocha (electron-mocha
actually) to unit test a lot of the functionality in my Electron app. I'm also using electron-log
's default instance to sprinkle copious (often VERY silly) logging messages throughout my code.
Here's the problem: When I run my Electron app, I can set the log level during my bootstrap process. But when I'm running my unit tests, that code doesn't get executed and electron-log defaults to outputting all levels of log messages, which really makes a mess of my unit test console.
Would you be open to an ELECTRON_LOG_CONSOLE_LEVEL environment variable (or similar) to set the fallback log.transports.consol.level
? If so, I'd be happy to take a swing at a pull request.
Or am I missing something? Is there another approach I should be taking?