From 4ff4f1244354b78a18d70db7ec663ed50e9cefb9 Mon Sep 17 00:00:00 2001 From: Simo Kinnunen Date: Tue, 7 Jan 2014 11:19:57 +0900 Subject: [PATCH] Rename log.prefix to log.globalPrefix. --- lib/util/logger.js | 9 +++++---- test/util/logger.js | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/util/logger.js b/lib/util/logger.js index aad83ff7..2fe9949e 100644 --- a/lib/util/logger.js +++ b/lib/util/logger.js @@ -39,21 +39,22 @@ Log.prototype.fatal = function() { Log.prototype._format = function(priority, args) { return util.format('%s %s/%s %d %s\n', - Log.prefix, priority, this.tag, process.pid, util.format.apply(util, args)) + Log.globalPrefix, priority, this.tag, process.pid, + util.format.apply(util, args)) } Log.prototype._write = function(out) { this.stream.write(out) } -Log.prefix = '*' +Log.globalPrefix = '*' Log.createLogger = function(tag) { return new Log(tag) } -Log.setPrefix = function(prefix) { - Log.prefix = prefix +Log.setGlobalPrefix = function(prefix) { + Log.globalPrefix = prefix } exports = module.exports = Log diff --git a/test/util/logger.js b/test/util/logger.js index 4afca5d3..47a7bd59 100644 --- a/test/util/logger.js +++ b/test/util/logger.js @@ -9,4 +9,8 @@ describe('Logger', function() { expect(logger).itself.to.respondTo('createLogger') }) + it('should have a setGlobalPrefix method', function() { + expect(logger).itself.to.respondTo('setGlobalPrefix') + }) + })