Merge pull request #338 from braydonf/logs
Add date to logs and formatting changes.
This commit is contained in:
commit
9832991c10
|
@ -6,8 +6,7 @@ var colors = require('colors/safe');
|
|||
* Wraps console.log with some special magic
|
||||
* @constructor
|
||||
*/
|
||||
function Logger(namespace) {
|
||||
this.namespace = namespace || 'bitcore-node';
|
||||
function Logger() {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -53,9 +52,9 @@ Logger.prototype._log = function(color, type) {
|
|||
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
args = args.slice(1);
|
||||
var name = colors.bold('{' + this.namespace + '}');
|
||||
var type = colors[color].italic(args.shift() + ':');
|
||||
args[0] = name + ' ' + type + ' ' + args[0];
|
||||
var date = new Date();
|
||||
var typeString = colors[color].italic(args.shift() + ':');
|
||||
args[0] = '[' + date.toISOString() + ']' + ' ' + typeString + ' ' + args[0];
|
||||
console.log.apply(console, args);
|
||||
};
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ Bitcoin.prototype._onTipUpdate = function(result) {
|
|||
// TODO stopping status
|
||||
if(!this.node.stopping) {
|
||||
var percentage = this.syncPercentage();
|
||||
log.info('Bitcoin Core Daemon New Height:', this.height, 'Percentage:', percentage);
|
||||
log.info('Bitcoin Height:', this.height, 'Percentage:', percentage);
|
||||
}
|
||||
|
||||
// Recursively wait until the next update
|
||||
|
|
Loading…
Reference in New Issue