From 941f671ed22a5c9e6ae9792a8b4ad354bb9b685b Mon Sep 17 00:00:00 2001 From: Nicolas Dextraze Date: Fri, 1 Nov 2019 11:10:16 -0700 Subject: [PATCH] Fix missing warn in Loggers --- src/common/log/fileLogger.js | 7 ++++++- src/common/log/noopLogger.js | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/common/log/fileLogger.js b/src/common/log/fileLogger.js index 8d19e22..009d303 100644 --- a/src/common/log/fileLogger.js +++ b/src/common/log/fileLogger.js @@ -26,6 +26,11 @@ FileLogger.prototype.info = function() { fs.appendFileSync(this._filePath, line); }; +FileLogger.prototype.warn = function() { + var line = createLine('WARN', arguments, 0); + fs.appendFileSync(this._filePath, line); +}; + FileLogger.prototype.error = function(e) { var hasError = e instanceof Error; var line = createLine('ERROR', arguments, hasError ? 1 : 0); @@ -36,4 +41,4 @@ FileLogger.prototype.error = function(e) { }; -module.exports = FileLogger; \ No newline at end of file +module.exports = FileLogger; diff --git a/src/common/log/noopLogger.js b/src/common/log/noopLogger.js index e9d3135..d5438ed 100644 --- a/src/common/log/noopLogger.js +++ b/src/common/log/noopLogger.js @@ -1,7 +1,8 @@ function NoopLogger() { } -NoopLogger.prototype.error = function() {}; NoopLogger.prototype.debug = function() {}; NoopLogger.prototype.info = function() {}; +NoopLogger.prototype.warn = function() {}; +NoopLogger.prototype.error = function() {}; -module.exports = NoopLogger; \ No newline at end of file +module.exports = NoopLogger;