From 4faab6aadc0f84bde5c6697ed711549ea72f69ae Mon Sep 17 00:00:00 2001 From: Konstantin Kuzmin Date: Wed, 23 May 2018 10:54:09 +0100 Subject: [PATCH] Add more verbose logging. --- lib/o365_mgmnt/index.js | 24 ++++++++++++++++++------ package.json | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/lib/o365_mgmnt/index.js b/lib/o365_mgmnt/index.js index 77ccaec..7b264e1 100644 --- a/lib/o365_mgmnt/index.js +++ b/lib/o365_mgmnt/index.js @@ -7,7 +7,9 @@ * @end * ----------------------------------------------------------------------------- */ - + +const util = require('util'); + const m_alUtil = require('../al_util'); const m_o365mgmnt = require('./o365management'); @@ -106,7 +108,9 @@ var _subscriptionsStart = function(contentType, webhook, callback) { function(error, result, httpRequest, response) { let retError = error; if (error) - retError = `O365 subscriptions/start ${error}`; + retError = util.format( + 'O365 subscriptions/start error. ContentType = %s, webhook = %j, error = %j', + contentType, webhook, error); return callback(retError, result, httpRequest, response); }); }; @@ -133,7 +137,9 @@ var _subscriptionsStop = function(contentType, callback) { function(error, result, httpRequest, response) { let retError = error; if (error) - retError = `O365 subscriptions/stop ${error}`; + retError = util.format( + 'O365 subscriptions/stop error. ContentType = %s, error = %j', + contentType, error); return callback(retError, result, httpRequest, response); }); }; @@ -162,7 +168,9 @@ var _subscriptionsContent = function(contentType, startTs, endTs, callback) { function(error, result, httpRequest, response) { let retError = error; if (error) - retError = `O365 subscriptions/content ${error}`; + retError = util.format( + 'O365 subscriptions/content error. ContentType = %s, startTs = %j, endTs = %j, error = %j', + contentType, startTs, endTs, error); return callback(retError, result, httpRequest, response); }); }; @@ -191,7 +199,9 @@ var _subscriptionsNotifications = function(contentType, startTs, endTs, callback function(error, result, httpRequest, response) { let retError = error; if (error) - retError = `O365 subscriptions/notifications ${error}`; + retError = util.format( + 'O365 subscriptions/notifications error. ContentType = %s, startTs = %j, endTs = %j, error = %j', + contentType, startTs, endTs, error); return callback(retError, result, httpRequest, response); }); }; @@ -217,7 +227,9 @@ var _getContent = function(contentUri, callback) { function(error, result, httpRequest, response) { let retError = error; if (error) - retError = `O365 fetch content ${error}`; + retError = util.format( + 'O365 fetch content error. uri = %s, error = %j', + contentUri, error); return callback(retError, result, httpRequest, response); }); }; diff --git a/package.json b/package.json index c676ee8..c730b69 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "azure_collector", - "version": "1.0.7", + "version": "1.0.8", "dependencies": { "async": "*", "azure": "^2.0.0-preview",