Skip to content

Commit 926bd81

Browse files
author
Javier
committedJan 20, 2016
add log level debug
1 parent 3a60786 commit 926bd81

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed
 

‎lib/pushnotificationsservice.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var Utils = require('./common/utils');
1212
var Model = require('./model');
1313
var log = require('npmlog');
1414
log.debug = log.verbose;
15+
log.level = 'debug';
1516

1617
var PUSHNOTIFICATIONS_TYPES = {
1718
'NewCopayer': {
@@ -97,10 +98,12 @@ PushNotificationsService.prototype._sendPushNotifications = function(notificatio
9798
var notifType = PUSHNOTIFICATIONS_TYPES[notification.type];
9899
if (!notifType) return cb();
99100

100-
// console.log(notification);
101+
log.debug('\n### Notification received\n', JSON.stringify(notification));
101102

102103
self._checkShouldSendNotif(notification, function(err, should) {
103104
if (err) return cb(err);
105+
106+
log.debug('\nShould send notification: ', should);
104107
if (!should) return cb();
105108

106109
self._getRecipientsList(notification, function(err, recipientsList) {
@@ -133,8 +136,8 @@ PushNotificationsService.prototype._sendPushNotifications = function(notificatio
133136
async.each(optsList,
134137
function(opts, next) {
135138
self._makeRequest(opts, function(err, response) {
136-
if (err) log.error(err);
137-
log.debug('Post status : ', response);
139+
if (err) log.error('ERROR!: ', err);
140+
log.debug('Request status : ', response);
138141
next();
139142
});
140143
},

‎pushnotificationsservice/pushnotificationsservice.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
var log = require('npmlog');
66
log.debug = log.verbose;
7+
log.level = 'debug';
78

89
var config = require('../config');
910
var PushNotificationsService = require('../lib/pushnotificationsservice');
@@ -12,5 +13,5 @@ var pushNotificationsService = new PushNotificationsService();
1213
pushNotificationsService.start(config, function(err) {
1314
if (err) throw err;
1415

15-
console.log('Push Notification Service started');
16+
log.debug('Push Notification Service started');
1617
});

0 commit comments

Comments
 (0)
Please sign in to comment.