This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PatternLayout.prototype.format = function(loggingEvent) { | |
var regex = /%(-?[0-9]+)?(\.?[0-9]+)?([acdflmMnpr%])(\{([^\}]+)\})?|([^%]+)/; | |
var formattedString = ""; | |
var result; | |
var searchString = this.pattern; | |
// Cannot use regex global flag since it doesn't work with exec in IE5 | |
while ((result = regex.exec(searchString))) { | |
var matchedString = result[0]; | |
var padding = result[1]; |