private void appendEventToBuffer(StringBuilder buf, Converter<ILoggingEvent> c, ILoggingEvent event) { buf.append("<td class=\""); buf.append(computeConverterName(c)); buf.append("\">"); buf.append(Transform.escapeTags(c.convert(event))); buf.append("</td>"); buf.append(LINE_SEPARATOR); }
/** * In its simplest incarnation, a convert simply appends the data extracted from * the event to the buffer passed as parameter. * * @param buf The input buffer where data is appended * @param event The event from where data is extracted */ public void write(StringBuilder buf, E event) { buf.append(convert(event)); }
public String convert(Object o) { StringBuilder buf = new StringBuilder(); Converter<Object> p = headTokenConverter; while (p != null) { buf.append(p.convert(o)); p = p.getNext(); } return buf.toString(); }
/** * Given date, convert this instance to a regular expression. * * Used to compute sub-regex when the pattern has both %d and %i, and the * date is known. */ public String toRegexForFixedDate(Date date) { StringBuilder buf = new StringBuilder(); Converter<Object> p = headTokenConverter; while (p != null) { if (p instanceof LiteralConverter) { buf.append(p.convert(null)); } else if (p instanceof IntegerTokenConverter) { buf.append("(\\d{1,3})"); } else if (p instanceof DateTokenConverter) { buf.append(p.convert(date)); } p = p.getNext(); } return buf.toString(); }
public String convertMultipleArguments(Object... objectList) { StringBuilder buf = new StringBuilder(); Converter<Object> c = headTokenConverter; while (c != null) { if (c instanceof MonoTypedConverter) { MonoTypedConverter monoTyped = (MonoTypedConverter) c; for (Object o : objectList) { if (monoTyped.isApplicable(o)) { buf.append(c.convert(o)); } } } else { buf.append(c.convert(objectList)); } c = c.getNext(); } return buf.toString(); }
/** * Given date, convert this instance to a regular expression */ public String toRegex() { StringBuilder buf = new StringBuilder(); Converter<Object> p = headTokenConverter; while (p != null) { if (p instanceof LiteralConverter) { buf.append(p.convert(null)); } else if (p instanceof IntegerTokenConverter) { buf.append("\\d{1,2}"); } else if (p instanceof DateTokenConverter) { DateTokenConverter<Object> dtc = (DateTokenConverter<Object>) p; buf.append(dtc.toRegex()); } p = p.getNext(); } return buf.toString(); } }
boolean computeParentCleaningFlag(FileNamePattern fileNamePattern) { DateTokenConverter dtc = fileNamePattern.getPrimaryDateTokenConverter(); // if the date pattern has a /, then we need parent cleaning if (dtc.getDatePattern().indexOf('/') != -1) { return true; } // if the literal string subsequent to the dtc contains a /, we also // need parent cleaning Converter<Object> p = fileNamePattern.headTokenConverter; // find the date converter while (p != null) { if (p instanceof DateTokenConverter) { break; } p = p.getNext(); } while (p != null) { if (p instanceof LiteralConverter) { String s = p.convert(null); if (s.indexOf('/') != -1) { return true; } } p = p.getNext(); } // no /, so we don't need parent cleaning return false; }
/** * In its simplest incarnation, a convert simply appends the data extracted from * the event to the buffer passed as parameter. * * @param buf The input buffer where data is appended * @param event The event from where data is extracted */ public void write(StringBuilder buf, E event) { buf.append(convert(event)); }
/** * In its simplest incarnation, a convert simply appends the data extracted from * the event to the buffer passed as parameter. * * @param buf The input buffer where data is appended * @param event The event from where data is extracted */ public void write(StringBuilder buf, E event) { buf.append(convert(event)); }
/** * In its simplest incarnation, a convert simply appends the data extracted from * the event to the buffer passed as parameter. * * @param buf The input buffer where data is appended * @param event The event from where data is extracted */ public void write(StringBuffer buf, E event) { buf.append(convert(event)); }
/** * In its simplest incarnation, a convert simply appends the data extracted from * the event to the buffer passed as parameter. * * @param buf The input buffer where data is appended * @param event The event from where data is extracted */ public void write(StringBuilder buf, E event) { buf.append(convert(event)); }
/** * In its simplest incarnation, a convert simply appends the data extracted from * the event to the buffer passed as parameter. * * @param buf The input buffer where data is appended * @param event The event from where data is extracted */ public void write(StringBuilder buf, E event) { buf.append(convert(event)); }
public String convert(Object o) { StringBuilder buf = new StringBuilder(); Converter<Object> p = headTokenConverter; while (p != null) { buf.append(p.convert(o)); p = p.getNext(); } return buf.toString(); }
public String convert(Object o) { StringBuilder buf = new StringBuilder(); Converter<Object> p = headTokenConverter; while (p != null) { buf.append(p.convert(o)); p = p.getNext(); } return buf.toString(); }
public String convert(Object o) { StringBuilder buf = new StringBuilder(); Converter<Object> p = headTokenConverter; while (p != null) { buf.append(p.convert(o)); p = p.getNext(); } return buf.toString(); }
private void appendEventToBuffer(StringBuilder buf, Converter<ILoggingEvent> c, ILoggingEvent event) { buf.append("<td class=\""); buf.append(computeConverterName(c)); buf.append("\">"); buf.append(c.convert(event)); buf.append("</td>"); buf.append(LINE_SEPARATOR); }
public String convert(Object o) { StringBuilder buf = new StringBuilder(); Converter<Object> p = headTokenConverter; while (p != null) { buf.append(p.convert(o)); p = p.getNext(); } return buf.toString(); }
public String convert(Object o) { StringBuilder buf = new StringBuilder(); Converter<Object> p = headTokenConverter; while (p != null) { buf.append(p.convert(o)); p = p.getNext(); } return buf.toString(); }
private void appendEventToBuffer(StringBuilder buf, Converter<ILoggingEvent> c, ILoggingEvent event) { buf.append("<td class=\""); buf.append(computeConverterName(c)); buf.append("\">"); buf.append(Transform.escapeTags(c.convert(event))); buf.append("</td>"); buf.append(LINE_SEPARATOR); }
private void appendEventToBuffer(StringBuilder buf, Converter<ILoggingEvent> c, ILoggingEvent event) { buf.append("<td class=\""); buf.append(computeConverterName(c)); buf.append("\">"); buf.append(Transform.escapeTags(c.convert(event))); buf.append("</td>"); buf.append(LINE_SEPARATOR); }