mirror of https://github.com/embarklabs/embark.git
Merge pull request #265 from aletheia-foundation/develop
fix crash in logger if message is null or undefined
This commit is contained in:
commit
06c2d9807d
|
@ -12,35 +12,35 @@ class Logger {
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.prototype.error = function (txt) {
|
Logger.prototype.error = function (txt) {
|
||||||
if (!(this.shouldLog('error'))) {
|
if (!txt || !(this.shouldLog('error'))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.logFunction(txt.red);
|
this.logFunction(txt.red);
|
||||||
};
|
};
|
||||||
|
|
||||||
Logger.prototype.warn = function (txt) {
|
Logger.prototype.warn = function (txt) {
|
||||||
if (!(this.shouldLog('warn'))) {
|
if (!txt || !(this.shouldLog('warn'))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.logFunction(txt.yellow);
|
this.logFunction(txt.yellow);
|
||||||
};
|
};
|
||||||
|
|
||||||
Logger.prototype.info = function (txt) {
|
Logger.prototype.info = function (txt) {
|
||||||
if (!(this.shouldLog('info'))) {
|
if (!txt || !(this.shouldLog('info'))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.logFunction(txt.green);
|
this.logFunction(txt.green);
|
||||||
};
|
};
|
||||||
|
|
||||||
Logger.prototype.debug = function (txt) {
|
Logger.prototype.debug = function (txt) {
|
||||||
if (!(this.shouldLog('debug'))) {
|
if (!txt || !(this.shouldLog('debug'))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.logFunction(txt);
|
this.logFunction(txt);
|
||||||
};
|
};
|
||||||
|
|
||||||
Logger.prototype.trace = function (txt) {
|
Logger.prototype.trace = function (txt) {
|
||||||
if (!(this.shouldLog('trace'))) {
|
if (!txt || !(this.shouldLog('trace'))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.logFunction(txt);
|
this.logFunction(txt);
|
||||||
|
|
Loading…
Reference in New Issue