diff --git a/lib/logging/module_logger.js b/lib/logging/module_logger.js index a73bc808..72f75376 100644 --- a/lib/logging/module_logger.js +++ b/lib/logging/module_logger.js @@ -28,7 +28,9 @@ function ModuleLogger(ringpop, configName) { } ModuleLogger.prototype.debug = function debug(msg, meta) { - this._log('debug', msg, meta); + // Logging at info level for "debug" logs is intentional. + // The level is controlled by config, not the logger itself. + this._log('debug', msg, meta, 'info'); }; ModuleLogger.prototype.info = function info(msg, meta) { @@ -56,7 +58,8 @@ ModuleLogger.prototype.canLogAt = function canLogAt(desiredLevel) { return configLevel !== Levels.off && configInt <= desiredInt; }; -ModuleLogger.prototype._log = function _log(msgLevel, msg, meta) { +ModuleLogger.prototype._log = function _log(msgLevel, msg, meta, loggerMethod) { + loggerMethod = loggerMethod || msgLevel; var configLevel = this.ringpop.config.get(this.configName); var configInt = Levels.convertStrToInt(configLevel); var msgInt = Levels.convertStrToInt(msgLevel); @@ -66,7 +69,7 @@ ModuleLogger.prototype._log = function _log(msgLevel, msg, meta) { !isNaN(msgInt) && msgInt >= configInt && msgInt < this.offInt) { - this.ringpop.logger[msgLevel](msg, meta); + this.ringpop.logger[loggerMethod](msg, meta); } };