Browse Source

Merge pull request #450 from tanojaja/fix/push-notifications-logs

fix push notifications service logs
activeAddress
Ivan Socolsky 9 years ago
parent
commit
9404dee2d8
  1. 13
      lib/pushnotificationsservice.js

13
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,12 @@ 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);
log.debug('Request message: ', response.statusMessage);
log.debug('Request body: ', response.request.body);
}
next();
});
},

Loading…
Cancel
Save