renamed categoryName -> category

This commit is contained in:
Gareth Jones 2013-08-26 22:48:50 +10:00
parent b6dc0b9557
commit 045b0dda2b
2 changed files with 14 additions and 14 deletions

View File

@ -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:
* <pre>
* [startTime] [logLevel] categoryName - message\n
* [startTime] [logLevel] category - message\n
* </pre>
*
* @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,

View File

@ -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"; }
}