From 41f430e521b0c111a3f61aaf65de1b267040938e Mon Sep 17 00:00:00 2001 From: Jeremy Daly Date: Thu, 1 Aug 2019 16:26:04 -0400 Subject: [PATCH] fix linting errors --- index.js | 4 ++-- lib/logger.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 52e0e40..77a173d 100644 --- a/index.js +++ b/index.js @@ -311,7 +311,7 @@ class API { // Output logs response._request._logs.forEach(log => { - this._logger.logger(JSON.stringify(this._logger.detail ? // eslint-disable-line no-console + this._logger.logger(JSON.stringify(this._logger.detail ? this._logger.format(log,response._request,response) : log)) }) @@ -321,7 +321,7 @@ class API { this._logger.log('access',undefined,response._request,response._request.context), { statusCode: res.statusCode, coldStart: response._request.coldStart, count: response._request.requestCount } ) - this._logger.logger(JSON.stringify(this._logger.format(access,response._request,response))) // eslint-disable-line no-console + this._logger.logger(JSON.stringify(this._logger.format(access,response._request,response))) } // Reset global error code diff --git a/lib/logger.js b/lib/logger.js index 01c9eb0..700ded3 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -91,7 +91,9 @@ exports.config = (config,levels) => { } // Overridable logging function - let logger = cfg.log && typeof cfg.log === 'function' ? cfg.log : (...a) => console.log(...a) + let logger = cfg.log && typeof cfg.log === 'function' ? + cfg.log : + (...a) => console.log(...a) // eslint-disable-line no-console // Main logging function let log = (level,msg,req,context,custom) => {