-
Notifications
You must be signed in to change notification settings - Fork 125
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
Environment variable for log.transports.console.level? #412
Comments
It looks like the electron-mocha supports require a generic module in the main process. I think that's the best way to configure the logging level for tests. |
My understanding is that electron-mocha has the capability of emulating code running in the main or renderer process. But it doesn't mean that all of the main or renderer process code is bootstrapped. If I'm testing a single isolated class from an individual file, that's the only code that will get run. What do you mean by "require a generic module in the main process"? You're referring to |
Yes |
I'm using Mocha (
electron-mocha
actually) to unit test a lot of the functionality in my Electron app. I'm also usingelectron-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?
The text was updated successfully, but these errors were encountered: