Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
add log level debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier committed Jan 20, 2016
1 parent 3a60786 commit 926bd81
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions lib/pushnotificationsservice.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var Utils = require('./common/utils');
var Model = require('./model');
var log = require('npmlog');
log.debug = log.verbose;
log.level = 'debug';

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

// console.log(notification);
log.debug('\n### Notification received\n', JSON.stringify(notification));

self._checkShouldSendNotif(notification, function(err, should) {
if (err) return cb(err);

log.debug('\nShould send notification: ', should);
if (!should) return cb();

self._getRecipientsList(notification, function(err, recipientsList) {
Expand Down Expand Up @@ -133,8 +136,8 @@ PushNotificationsService.prototype._sendPushNotifications = function(notificatio
async.each(optsList,
function(opts, next) {
self._makeRequest(opts, function(err, response) {
if (err) log.error(err);
log.debug('Post status : ', response);
if (err) log.error('ERROR!: ', err);
log.debug('Request status : ', response);
next();
});
},
Expand Down
3 changes: 2 additions & 1 deletion pushnotificationsservice/pushnotificationsservice.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

var log = require('npmlog');
log.debug = log.verbose;
log.level = 'debug';

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

console.log('Push Notification Service started');
log.debug('Push Notification Service started');

This comment has been minimized.

Copy link
@Soonray1818

Soonray1818 Dec 31, 2017

no

});

0 comments on commit 926bd81

Please sign in to comment.