Skip to content

Commit

Permalink
fix: fixed issue with logger return value and override
Browse files Browse the repository at this point in the history
  • Loading branch information
niftylettuce committed May 26, 2020
1 parent f79418e commit 25e5fa5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit 25e5fa5

Please sign in to comment.