From b4d94da709c73fd381443e3bbfa39c29b43579a2 Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 26 Jan 2016 16:36:03 -0300 Subject: [PATCH] fix push notifications service logs --- lib/pushnotificationsservice.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/pushnotificationsservice.js b/lib/pushnotificationsservice.js index 84ecc35..b8ca031 100644 --- a/lib/pushnotificationsservice.js +++ b/lib/pushnotificationsservice.js @@ -98,12 +98,13 @@ PushNotificationsService.prototype._sendPushNotifications = function(notificatio var notifType = PUSHNOTIFICATIONS_TYPES[notification.type]; if (!notifType) return cb(); - log.debug('\n### Notification received\n', JSON.stringify(notification)); + log.debug('### Notification received: ' + notification.type); + log.debug(JSON.stringify(notification)); self._checkShouldSendNotif(notification, function(err, should) { if (err) return cb(err); - log.debug('\nShould send notification: ', should); + log.debug('Should send notification: ', should); if (!should) return cb(); self._getRecipientsList(notification, function(err, recipientsList) { @@ -137,8 +138,8 @@ PushNotificationsService.prototype._sendPushNotifications = function(notificatio async.each(optsList, function(opts, next) { self._makeRequest(opts, function(err, response) { - if (err) log.error('ERROR!: ', err); - log.debug('Request status : ', response); + if (err) log.error(err); + if (response) log.debug('Request status : ', response.statusCode); next(); }); },