@@ -12,6 +12,7 @@ var Utils = require('./common/utils');
12
12
var Model = require ( './model' ) ;
13
13
var log = require ( 'npmlog' ) ;
14
14
log . debug = log . verbose ;
15
+ log . level = 'debug' ;
15
16
16
17
var PUSHNOTIFICATIONS_TYPES = {
17
18
'NewCopayer' : {
@@ -97,10 +98,12 @@ PushNotificationsService.prototype._sendPushNotifications = function(notificatio
97
98
var notifType = PUSHNOTIFICATIONS_TYPES [ notification . type ] ;
98
99
if ( ! notifType ) return cb ( ) ;
99
100
100
- // console.log (notification);
101
+ log . debug ( '\n### Notification received\n' , JSON . stringify ( notification ) ) ;
101
102
102
103
self . _checkShouldSendNotif ( notification , function ( err , should ) {
103
104
if ( err ) return cb ( err ) ;
105
+
106
+ log . debug ( '\nShould send notification: ' , should ) ;
104
107
if ( ! should ) return cb ( ) ;
105
108
106
109
self . _getRecipientsList ( notification , function ( err , recipientsList ) {
@@ -133,8 +136,8 @@ PushNotificationsService.prototype._sendPushNotifications = function(notificatio
133
136
async . each ( optsList ,
134
137
function ( opts , next ) {
135
138
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 ) ;
138
141
next ( ) ;
139
142
} ) ;
140
143
} ,
0 commit comments