mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-17 08:07:51 +00:00
Merge pull request #352 from embark-framework/bug_fix/async_log_fix
Fix console.dir messing up the console
This commit is contained in:
commit
586ecd00c8
@ -64,6 +64,16 @@ Logger.prototype.trace = function (txt) {
|
|||||||
this.writeToFile("[trace]: " + txt);
|
this.writeToFile("[trace]: " + txt);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Logger.prototype.dir = function (txt) {
|
||||||
|
if (!txt || !(this.shouldLog('info'))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.events.emit("log", "dir", txt);
|
||||||
|
this.logFunction(txt);
|
||||||
|
this.writeToFile("[dir]: ");
|
||||||
|
this.writeToFile(txt);
|
||||||
|
};
|
||||||
|
|
||||||
Logger.prototype.shouldLog = function (level) {
|
Logger.prototype.shouldLog = function (level) {
|
||||||
return (this.logLevels.indexOf(level) <= this.logLevels.indexOf(this.logLevel));
|
return (this.logLevels.indexOf(level) <= this.logLevels.indexOf(this.logLevel));
|
||||||
};
|
};
|
||||||
|
@ -77,6 +77,9 @@ Plugin.prototype.interceptLogs = function(context) {
|
|||||||
context.console.trace = function(txt) {
|
context.console.trace = function(txt) {
|
||||||
self.logger.trace(self.name + " > " + txt);
|
self.logger.trace(self.name + " > " + txt);
|
||||||
};
|
};
|
||||||
|
context.console.dir = function(txt) {
|
||||||
|
self.logger.dir(txt);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: add deploy provider
|
// TODO: add deploy provider
|
||||||
|
Loading…
x
Reference in New Issue
Block a user