refactor logs

This commit is contained in:
Javier 2016-01-29 10:02:44 -03:00
parent b4d94da709
commit e622e28c76
1 changed files with 6 additions and 2 deletions

View File

@ -98,7 +98,7 @@ PushNotificationsService.prototype._sendPushNotifications = function(notificatio
var notifType = PUSHNOTIFICATIONS_TYPES[notification.type];
if (!notifType) return cb();
log.debug('### Notification received: ' + notification.type);
log.debug('Notification received: ' + notification.type);
log.debug(JSON.stringify(notification));
self._checkShouldSendNotif(notification, function(err, should) {
@ -139,7 +139,11 @@ PushNotificationsService.prototype._sendPushNotifications = function(notificatio
function(opts, next) {
self._makeRequest(opts, function(err, response) {
if (err) log.error(err);
if (response) log.debug('Request status : ', response.statusCode);
if (response) {
log.debug('Request status: ', response.statusCode);
log.debug('Request message: ', response.statusMessage);
log.debug('Request body: ', response.request.body);
}
next();
});
},