Merge pull request #268 from askhogan/master
Allow for blank tokens due to dynamic data
This commit is contained in:
commit
d10d40b572
@ -295,9 +295,7 @@ function patternLayout (pattern, tokens) {
|
|||||||
} else {
|
} else {
|
||||||
// Create a raw replacement string based on the conversion
|
// Create a raw replacement string based on the conversion
|
||||||
// character and specifier
|
// character and specifier
|
||||||
var replacement =
|
var replacement = replaceToken(conversionCharacter, loggingEvent, specifier);
|
||||||
replaceToken(conversionCharacter, loggingEvent, specifier) ||
|
|
||||||
matchedString;
|
|
||||||
|
|
||||||
// Format the replacement according to any padding or
|
// Format the replacement according to any padding or
|
||||||
// truncation specified
|
// truncation specified
|
||||||
|
@ -282,14 +282,14 @@ vows.describe('log4js layouts').addBatch({
|
|||||||
test(args, '%x{testFunction}', 'testFunctionToken');
|
test(args, '%x{testFunction}', 'testFunctionToken');
|
||||||
},
|
},
|
||||||
'%x{doesNotExist} should output the string stored in tokens': function(args) {
|
'%x{doesNotExist} should output the string stored in tokens': function(args) {
|
||||||
test(args, '%x{doesNotExist}', '%x{doesNotExist}');
|
test(args, '%x{doesNotExist}', 'null');
|
||||||
},
|
},
|
||||||
'%x{fnThatUsesLogEvent} should be able to use the logEvent': function(args) {
|
'%x{fnThatUsesLogEvent} should be able to use the logEvent': function(args) {
|
||||||
test(args, '%x{fnThatUsesLogEvent}', 'DEBUG');
|
test(args, '%x{fnThatUsesLogEvent}', 'DEBUG');
|
||||||
},
|
},
|
||||||
'%x should output the string stored in tokens': function(args) {
|
'%x should output the string stored in tokens': function(args) {
|
||||||
test(args, '%x', '%x');
|
test(args, '%x', 'null');
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
'layout makers': {
|
'layout makers': {
|
||||||
topic: require('../lib/layouts'),
|
topic: require('../lib/layouts'),
|
||||||
|
Loading…
Reference in New Issue
Block a user