Add an API for disabling logging (T6955)
Issue originally made by @maxbrunsfeld
Bug information
- Babel version: v6.4.0
- Node version: v4.1.1
Description
In the Atom editor, we use babel-core to compile ES6 files to ES5 on demand, at runtime. Windows users are reporting errors that happen when babel tries to [[ https://github.com/babel/babel/blob/master/packages/babel-core/src/transformation/file/logger.js#L50 | log to stderr ]], because windows GUI processes don't have a stderr stream.
It appears that the logging is [[ https://github.com/visionmedia/debug#usage | enabled or disabled by the DEBUG environment variable ]]. We would like to have some programmatic way of disabling the logging.
Sorry, didn't see this until now (literally going through all the issues). Will discuss a fix (we definetely don't want monkeypatching in atom/electron 😁).
Is this an issue that will be fixed by using debug properly? Babel 6 was hard-coded to debug/node but we're fixing that to use debug directly, and that currently has https://github.com/visionmedia/debug/blob/master/src/index.js#L2 to handle Electron, will that handling also address the issue for Atom?
I would advocate to get this option in as soon as possible if https://github.com/babel/babel/pull/6859 will be merged. Ran into an issue with some of our internal tooling which kills the process if process.stderr receives data. Right now we ignore Babel [note] messages from the stream.
It would be nice to have more granular control of the type of messages that are displayed. The data filtering we have in place right now works, but is not very future proof. I don't mind poking around in code to make this work.