final String relativeTimeDateFormat = "RELATIVE";
AbstractField logField = null;
switch (patternChar) {
case 'c':
logField = new NamedField(LogFieldName.CATEGORY, leftAlign, rightAlign, extractPrecisionOption());
break;
case 'C':
logField = new NamedField(LogFieldName.CLASS, leftAlign, rightAlign, extractPrecisionOption());
break;
case 'd':
String dateFormatString = "yyyy-MM-dd HH:mm:ss,SSS"; // 'ISO8601' date format
String dOpt = extractOption();
if ((dOpt != null) && !dOpt.equalsIgnoreCase(isoDateFormat)) {
if (dOpt.equalsIgnoreCase(absTimeDateFormat)) {
dateFormatString = "HH:mm:ss,SSS";
} else if (dOpt.equalsIgnoreCase(dateAndTimeDateFormat)) {
dateFormatString = "dd MMM yyyy HH:mm:ss,SSS";
} else if (dOpt.equalsIgnoreCase(relativeTimeDateFormat)) {
dateFormatString = "SSSS";
} else {
dateFormatString = dOpt;
}
}
logField = new DateField(LogFieldName.DATE, leftAlign, rightAlign, dateFormatString);
break;
case 'F':
logField = new NamedField(LogFieldName.FILE, leftAlign, rightAlign, 2);
break;
case 'L':
logField = new NumberedField(LogFieldName.LINE, leftAlign, rightAlign);
break;
case 'm':
logField = new WildcardField(LogFieldName.MESSAGE, leftAlign, rightAlign);
break;
case 'M':
logField = new NamedField(LogFieldName.METHOD, leftAlign, rightAlign, 1);
break;
case 'p':
logField = new LevelField(LogFieldName.LEVEL, leftAlign, rightAlign);
break;