From 229008898d19000afa949bb3790f358b445de81e Mon Sep 17 00:00:00 2001 From: Micah Date: Thu, 17 Jul 2014 12:50:17 -0400 Subject: [PATCH] logging for blue button --- lib/logger.js | 21 +++++++++++++++++++++ package.json | 1 + 2 files changed, 22 insertions(+) create mode 100644 lib/logger.js diff --git a/lib/logger.js b/lib/logger.js new file mode 100644 index 00000000..565de3c0 --- /dev/null +++ b/lib/logger.js @@ -0,0 +1,21 @@ +"use strict"; +var winston = require('winston'); + +var logger = new(winston.Logger)({ + "exitOnError": true, + "transports": [ + new(winston.transports.Console)({ + "colorize": true, + "handleExceptions": true, + "timestamp": true, + }), + ] +}); + +logger.log = function () { + var args = Array.prototype.slice.call(arguments); + args.splice(1, 0, '[BB]'); + winston.Logger.prototype.log.apply(this, args); +}; + +module.exports = logger; diff --git a/package.json b/package.json index 5113845f..d16ae387 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "libxmljs": "*", "node-uuid": "*", "underscore": "1.6.x", + "winston": "^0.7.3", "xdate": "*", "z-schema": "^2.4.8" },