From 045b0dda2b9930cd6fda524f89dd61d99336c713 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Mon, 26 Aug 2013 22:48:50 +1000 Subject: [PATCH] renamed categoryName -> category --- lib/layouts.js | 10 +++++----- test/layouts-test.js | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/layouts.js b/lib/layouts.js index 9cfd035..9043448 100644 --- a/lib/layouts.js +++ b/lib/layouts.js @@ -77,7 +77,7 @@ function timestampLevelAndCategory(loggingEvent, colour) { '[%s] [%s] %s - ' , dateFormat.asString(loggingEvent.startTime) , loggingEvent.level - , loggingEvent.categoryName + , loggingEvent.category ) , colour ); @@ -88,7 +88,7 @@ function timestampLevelAndCategory(loggingEvent, colour) { * BasicLayout is a simple layout for storing the logs. The logs are stored * in following format: *
- * [startTime] [logLevel] categoryName - message\n
+ * [startTime] [logLevel] category - message\n
  * 
* * @author Stephan Strittmatter @@ -148,8 +148,8 @@ function patternLayout (pattern, tokens) { pattern = pattern || TTCC_CONVERSION_PATTERN; - function categoryName(loggingEvent, specifier) { - var loggerName = loggingEvent.categoryName; + function category(loggingEvent, specifier) { + var loggerName = loggingEvent.category; if (specifier) { var precision = parseInt(specifier, 10); var loggerNameBits = loggerName.split("."); @@ -223,7 +223,7 @@ function patternLayout (pattern, tokens) { } var replacers = { - 'c': categoryName, + 'c': category, 'd': formatAsDate, 'h': hostname, 'm': formatMessage, diff --git a/test/layouts-test.js b/test/layouts-test.js index d1232b7..26bce67 100644 --- a/test/layouts-test.js +++ b/test/layouts-test.js @@ -14,7 +14,7 @@ describe('log4js layouts', function() { var output = layout({ data: ["nonsense"], startTime: new Date(2010, 11, 5, 14, 18, 30, 45), - categoryName: "cheese", + category: "cheese", level: { toString: function() { return "ERROR"; } } @@ -26,7 +26,7 @@ describe('log4js layouts', function() { var output = layout({ data: ["thing %d", 2], startTime: new Date(2010, 11, 5, 14, 18, 30, 45), - categoryName: "cheese", + category: "cheese", level: { toString: function() { return "ERROR"; } } @@ -43,7 +43,7 @@ describe('log4js layouts', function() { assert.equal(layout({ data: ["nonsense"], startTime: new Date(2010, 11, 5, 14, 18, 30, 45), - categoryName: "cheese", + category: "cheese", level: { colour: "green", toString: function() { return "ERROR"; } @@ -55,7 +55,7 @@ describe('log4js layouts', function() { assert.equal(layout({ data: ["thing %d", 1, "cheese"], startTime: new Date(2010, 11, 5, 14, 18, 30, 45), - categoryName: "cheese", + category: "cheese", level : { colour: "green", toString: function() { return "ERROR"; } @@ -67,7 +67,7 @@ describe('log4js layouts', function() { assert.equal(layout({ data: [ { thing: 1} ], startTime: new Date(2010, 11, 5, 14, 18, 30, 45), - categoryName: "cheese", + category: "cheese", level: { colour: "green", toString: function() { return "ERROR"; } @@ -81,7 +81,7 @@ describe('log4js layouts', function() { layout({ data: [ new Error() ], startTime: new Date(2010, 11, 5, 14, 18, 30, 45), - categoryName: "cheese", + category: "cheese", level: { colour: "green", toString: function() { return "ERROR"; } @@ -105,7 +105,7 @@ describe('log4js layouts', function() { layoutOutput = layout({ data: [ e ], startTime: new Date(2010, 11, 5, 14, 18, 30, 45), - categoryName: "cheese", + category: "cheese", level: { colour: "green", toString: function() { return "ERROR"; } @@ -136,7 +136,7 @@ describe('log4js layouts', function() { , event = { data: ['this is a test'], startTime: new Date(2010, 11, 5, 14, 18, 30, 45), - categoryName: "tests", + category: "tests", level: { toString: function() { return "DEBUG"; } } @@ -188,7 +188,7 @@ describe('log4js layouts', function() { var event = { data: ['this is a test'], startTime: new Date(2010, 11, 5, 14, 18, 30, 45), - categoryName: "multiple.levels.of.tests", + category: "multiple.levels.of.tests", level: { toString: function() { return "DEBUG"; } }