fixed patternlayout, needs tests though

This commit is contained in:
Gareth Jones 2011-07-13 18:42:56 +10:00
parent d7ffa59434
commit 3691648cd0

View File

@ -127,12 +127,12 @@ function patternLayout (pattern) {
var TTCC_CONVERSION_PATTERN = "%r %p %c - %m%n";
var regex = /%(-?[0-9]+)?(\.?[0-9]+)?([cdmnpr%])(\{([^\}]+)\})?|([^%]+)/;
pattern = pattern || patternLayout.TTCC_CONVERSION_PATTERN;
pattern = pattern || TTCC_CONVERSION_PATTERN;
return function(loggingEvent) {
var formattedString = "";
var result;
var searchString = this.pattern;
var searchString = pattern;
while ((result = regex.exec(searchString))) {
var matchedString = result[0];
@ -181,7 +181,7 @@ function patternLayout (pattern) {
replacement = dateFormat.asString(format, loggingEvent.startTime);
break;
case "m":
replacement = loggingEvent.message;
replacement = formatLogData(loggingEvent.data);
break;
case "n":
replacement = "\n";