From 8de655eb2b2072899cc17ba1100841964819cb50 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Wed, 20 Aug 2014 15:58:21 -0400 Subject: [PATCH] improve logging on Sync --- lib/Sync.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Sync.js b/lib/Sync.js index 60f160fb..36b0fa7d 100644 --- a/lib/Sync.js +++ b/lib/Sync.js @@ -86,10 +86,10 @@ Sync.prototype.storeTipBlock = function(b, allowReorgs, cb) { var self = this; if ( self.storingBlock ) { - console.log('## Storing a block already. Delaying storeTipBlock with:' + + logger.debug('Storing a block already. Delaying storeTipBlock with:' + b.hash); return setTimeout( function() { - console.log('## Retrying storeTipBlock with: ' + b.hash); + logger.debug('Retrying storeTipBlock with: ' + b.hash); self.storeTipBlock(b,allowReorgs,cb); }, 1000); } @@ -123,7 +123,7 @@ Sync.prototype.storeTipBlock = function(b, allowReorgs, cb) { oldHeight = hash ? (h || 0) : -1 if (oldTip && newPrev !== oldTip) { needReorg = true; - console.log('## REORG Triggered, tip mismatch'); + logger.debug('REORG Triggered, tip mismatch'); } return c(); }); @@ -195,7 +195,7 @@ Sync.prototype.processReorg = function(oldTip, oldNext, newPrev, oldHeight, cb) if (height<0) return c(); newHeight = height + 1; - info('# Reorg Case 1) OldNext: %s NewHeight: %d', oldNext, newHeight); + info('Reorg Case 1) OldNext: %s NewHeight: %d', oldNext, newHeight); orphanizeFrom = oldNext; return c(err); }); @@ -203,7 +203,7 @@ Sync.prototype.processReorg = function(oldTip, oldNext, newPrev, oldHeight, cb) function(c) { if (orphanizeFrom) return c(); - info('# Reorg Case 2)'); + info('Reorg Case 2)'); self.setBranchConnectedBackwards(newPrev, function(err, yHash, newYHashNext, height) { if (err) return c(err); newHeight = height;