fixed logging

This commit is contained in:
cubedro 2015-05-28 13:40:51 +03:00
parent 60984af4c9
commit 79d29cee4d
1 changed files with 7 additions and 4 deletions

View File

@ -358,10 +358,11 @@ Node.prototype.getLatestBlock = function ()
if(this._web3)
{
console.time('==>', 'Got block in');
var timeString = 'Got block in' + chalk.reset.red('');
console.time('==>', timeString);
web3.eth.getBlock('latest', false, function(error, result) {
self.validateLatestBlock(error, result, 'Got block in');
self.validateLatestBlock(error, result, timeString);
});
}
}
@ -568,11 +569,13 @@ Node.prototype.setWatches = function()
this._latestQueue = async.queue(function (hash, callback)
{
console.time('==>', 'Got block ' + hash + ' in');
var timeString = 'Got block in ' + chalk.reset.red(hash) + chalk.reset.bold.white(' in') + chalk.reset.green('');
console.time('==>', timeString);
web3.eth.getBlock(hash, false, function (error, result)
{
self.validateLatestBlock(error, result, 'Got block ' + hash + ' in');
self.validateLatestBlock(error, result, timeString);
callback();
});