From 3f8325d0232aff30dec25c30f680ed90e44acd2a Mon Sep 17 00:00:00 2001 From: omenocal Date: Thu, 28 Jun 2018 15:08:45 -0600 Subject: [PATCH] Replaced debug by lambda-logs package --- lib/Voxa-Dashbot.js | 10 +++++----- package.json | 6 +++--- tests/voxa-dashbot.spec.js | 2 -- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/Voxa-Dashbot.js b/lib/Voxa-Dashbot.js index ebea037..3b1fd83 100644 --- a/lib/Voxa-Dashbot.js +++ b/lib/Voxa-Dashbot.js @@ -2,7 +2,7 @@ const _ = require('lodash'); const DashbotAnalytics = require('dashbot'); -const debug = require('debug')('voxa:dashbot'); +const lambdaLog = require('lambda-log'); const defaultConfig = { ignoreUsers: [], @@ -30,7 +30,7 @@ function register(skill, config) { if (pluginConfig.suppressSending) return Promise.resolve(null); if (isSessionEndedRequest && request.request.type !== 'SessionEndedRequest') return Promise.resolve(null); - debug('Sending to dashbot'); + lambdaLog.info('Sending to dashbot'); const newRequestObject = _.pick(request, ['version', 'session', 'context', 'request']); @@ -38,18 +38,18 @@ function register(skill, config) { return Dashbot.logIncoming(newRequestObject) .then(response => response.text()) .then((response) => { - debug('logIncoming response', response); + lambdaLog.info('logIncoming response', { response }); // PROCESSING OUTGOING RESPONSE return Dashbot.logOutgoing(newRequestObject, reply.toJSON()); }) .then(response => response.text()) .then((response) => { - debug('logOutgoing response', response); + lambdaLog.info('logOutgoing response', { response }); return response; }) .catch((err) => { - debug('err', err); + lambdaLog.error(err); }); } } diff --git a/package.json b/package.json index 3467793..0342d85 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "test": "istanbul cover _mocha -- --recursive tests", "test-ci": "JUNIT_REPORT_PATH=junit.xml istanbul cover _mocha -- --recursive --colors --reporter mocha-jenkins-reporter tests", "cobertura": "istanbul report cobertura --root coverage", - "lint": "eslint --fix lib/ tests/", - "lint-fix": "eslint lib/ tests/" + "lint": "eslint lib/ tests/", + "lint-fix": "eslint --fix lib/ tests/" }, "repository": { "type": "git", @@ -32,7 +32,7 @@ "license": "MIT", "dependencies": { "dashbot": "^9.9.1", - "debug": "^2.6.9", + "lambda-log": "^1.4.0", "lodash": "^4.17.10" }, "devDependencies": { diff --git a/tests/voxa-dashbot.spec.js b/tests/voxa-dashbot.spec.js index 7243f48..53790ec 100644 --- a/tests/voxa-dashbot.spec.js +++ b/tests/voxa-dashbot.spec.js @@ -10,8 +10,6 @@ const voxaDashbot = require('../lib/Voxa-Dashbot'); const views = require('./views'); const version = require('../package').dependencies.dashbot.replace('^', ''); -console.log('DASHBOT VERSION', version); - const expect = chai.expect; const DASHBOT_URL = 'https://tracker.dashbot.io'; const dashbotConfig = {