add verbose mode to logging
This commit is contained in:
parent
4194857086
commit
c60ad89937
@ -1,4 +1,7 @@
|
||||
import * as util from "../../util";
|
||||
import buildDebug from "debug/node";
|
||||
|
||||
var verboseDebug = buildDebug("babel:verbose");
|
||||
var generalDebug = buildDebug("babel");
|
||||
|
||||
export default class Logger {
|
||||
constructor(file: File, filename: string) {
|
||||
@ -22,11 +25,15 @@ export default class Logger {
|
||||
}
|
||||
}
|
||||
|
||||
verbose(msg: string) {
|
||||
if (verboseDebug.enabled) verboseDebug(this._buildMessage(msg));
|
||||
}
|
||||
|
||||
debug(msg: string) {
|
||||
util.debug(this._buildMessage(msg));
|
||||
if (generalDebug.enabled) generalDebug(this._buildMessage(msg));
|
||||
}
|
||||
|
||||
deopt(node: Object, msg: string) {
|
||||
util.debug(this._buildMessage(msg));
|
||||
this.debug(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import "./patch";
|
||||
|
||||
import escapeRegExp from "lodash/string/escapeRegExp";
|
||||
import buildDebug from "debug/node";
|
||||
|
||||
import cloneDeep from "lodash/lang/cloneDeep";
|
||||
import isBoolean from "lodash/lang/isBoolean";
|
||||
import * as messages from "./messages";
|
||||
@ -22,8 +22,6 @@ import slash from "slash";
|
||||
|
||||
export { inherits, inspect } from "util";
|
||||
|
||||
export var debug = buildDebug("babel");
|
||||
|
||||
export function canCompile(filename: string, altExts?: Array<string>) {
|
||||
var exts = altExts || canCompile.EXTENSIONS;
|
||||
var ext = path.extname(filename);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user