Browse Source

Fix missing warn in Loggers

master
Nicolas Dextraze 3 years ago
parent
commit
941f671ed2
  1. 7
      src/common/log/fileLogger.js
  2. 5
      src/common/log/noopLogger.js

7
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;
module.exports = FileLogger;

5
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;
module.exports = NoopLogger;

Loading…
Cancel
Save