From 25e5fa52fa715b3545bc17df432e4dda5c8fdf6f Mon Sep 17 00:00:00 2001 From: niftylettuce Date: Tue, 26 May 2020 18:49:02 -0500 Subject: [PATCH] fix: fixed issue with logger return value and override --- src/middleware.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/middleware.js b/src/middleware.js index 136fe4d..aa5fe5b 100644 --- a/src/middleware.js +++ b/src/middleware.js @@ -18,8 +18,7 @@ module.exports = function(...args) { Object.keys(this.logger) .filter(key => isFunction(this.logger[key])) .forEach(key => { - const _logger = this.logger[key]; - this.logger[key] = (...params) => { + logger[key] = (...params) => { if (isUndefined(params[1])) params[1] = {}; else params[1] = this.parseArg(params[1]); // add `request` object to metadata @@ -66,7 +65,7 @@ module.exports = function(...args) { ) ); - return _logger(...[].slice.call(params)); + return this.logger[key](...[].slice.call(params)); }; logger[key] = this.logger[key];