diff --git a/lib/core/logger.js b/lib/core/logger.js index 00ae34755..f1011f8a0 100644 --- a/lib/core/logger.js +++ b/lib/core/logger.js @@ -24,7 +24,7 @@ Logger.prototype.error = function () { return; } this.events.emit("log", "error", ...arguments); - this.logFunction(...Array.from(arguments).map(t => t.red)); + this.logFunction(...Array.from(arguments).map(t => t ? t.red : t)); this.writeToFile("[error]: ", ...arguments); }; @@ -33,7 +33,7 @@ Logger.prototype.warn = function () { return; } this.events.emit("log", "warning", ...arguments); - this.logFunction(...Array.from(arguments).map(t => t.yellow)); + this.logFunction(...Array.from(arguments).map(t => t ? t.yellow : t)); this.writeToFile("[warning]: ", ...arguments); }; @@ -42,7 +42,7 @@ Logger.prototype.info = function () { return; } this.events.emit("log", "info", ...arguments); - this.logFunction(...Array.from(arguments).map(t => t.green)); + this.logFunction(...Array.from(arguments).map(t => t ? t.green : t)); this.writeToFile("[info]: ", ...arguments); };