From 17b669c98fdc8a075b672be8e0eba00c035a11e1 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Wed, 21 Oct 2015 14:47:35 -0400 Subject: [PATCH] Add date to logs and formatting changes. --- lib/logger.js | 9 ++++----- lib/services/bitcoind.js | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/logger.js b/lib/logger.js index ea997b5a..eb627650 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -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); }; diff --git a/lib/services/bitcoind.js b/lib/services/bitcoind.js index 87e7ebc9..9ca73c01 100644 --- a/lib/services/bitcoind.js +++ b/lib/services/bitcoind.js @@ -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