/** * Formats a logging event to a writer. * @param event logging event to be formatted. */ public String format(final LoggingEvent event) { StringBuffer buf = new StringBuffer(); for(PatternConverter c = head; c != null; c = c.next) { c.format(buf, event); } return buf.toString(); }
/** A template method for formatting in a converter specific way. */ public void format(StringBuffer sbuf, LoggingEvent e) { String s = convert(e); if(s == null) { if(0 < min) spacePad(sbuf, min); return; } int len = s.length(); if(len > max) sbuf.append(s.substring(len-max)); else if(len < min) { if(leftAlign) { sbuf.append(s); spacePad(sbuf, min-len); } else { spacePad(sbuf, min-len); sbuf.append(s); } } else sbuf.append(s); }
/** A template method for formatting in a converter specific way. */ public void format(StringBuffer sbuf, LoggingEvent e) { String s = convert(e); if(s == null) { if(0 < min) spacePad(sbuf, min); return; } int len = s.length(); if(len > max) sbuf.append(s.substring(len-max)); else if(len < min) { if(leftAlign) { sbuf.append(s); spacePad(sbuf, min-len); } else { spacePad(sbuf, min-len); sbuf.append(s); } } else sbuf.append(s); }
/** Produces a formatted string as specified by the conversion pattern. */ public String format(LoggingEvent event) { // Reset working stringbuffer if(sbuf.capacity() > MAX_CAPACITY) { sbuf = new StringBuffer(BUF_SIZE); } else { sbuf.setLength(0); } PatternConverter c = head; while(c != null) { c.format(sbuf, event); c = c.next; } return sbuf.toString(); } }
/** A template method for formatting in a converter specific way. */ public void format(StringBuffer sbuf, LoggingEvent e) { String s = convert(e); if(s == null) { if(0 < min) { spacePad(sbuf, min); } return; } int len = s.length(); if(len > max) { sbuf.append(s.substring(len-max)); } else if(len < min) { if(leftAlign) { sbuf.append(s); spacePad(sbuf, min-len); } else { spacePad(sbuf, min-len); sbuf.append(s); } } else { sbuf.append(s); } }
/** * Formats a logging event to a writer. * @param event logging event to be formatted. */ public String format(final LoggingEvent event) { StringBuffer buf = new StringBuffer(); for(PatternConverter c = head; c != null; c = c.next) { c.format(buf, event); } return buf.toString(); }
/** A template method for formatting in a converter specific way. */ public void format(StringBuffer sbuf, LoggingEvent e) { String s = convert(e); if(s == null) { if(0 < min) spacePad(sbuf, min); return; } int len = s.length(); if(len > max) sbuf.append(s.substring(len-max)); else if(len < min) { if(leftAlign) { sbuf.append(s); spacePad(sbuf, min-len); } else { spacePad(sbuf, min-len); sbuf.append(s); } } else sbuf.append(s); }
/** Produces a formatted string as specified by the conversion pattern. */ public String format(LoggingEvent event) { // Reset working stringbuffer if(sbuf.capacity() > MAX_CAPACITY) { sbuf = new StringBuffer(BUF_SIZE); } else { sbuf.setLength(0); } PatternConverter c = head; while(c != null) { c.format(sbuf, event); c = c.next; } return sbuf.toString(); } }
/** A template method for formatting in a converter specific way. */ public void format(StringBuffer sbuf, LoggingEvent e) { String s = convert(e); if(s == null) { if(0 < min) spacePad(sbuf, min); return; } int len = s.length(); if(len > max) sbuf.append(s.substring(len-max)); else if(len < min) { if(leftAlign) { sbuf.append(s); spacePad(sbuf, min-len); } else { spacePad(sbuf, min-len); sbuf.append(s); } } else sbuf.append(s); }
/** Produces a formatted string as specified by the conversion pattern. */ public String format(LoggingEvent event) { // Reset working stringbuffer if(sbuf.capacity() > MAX_CAPACITY) { sbuf = new StringBuffer(BUF_SIZE); } else { sbuf.setLength(0); } PatternConverter c = head; while(c != null) { c.format(sbuf, event); c = c.next; } return sbuf.toString(); } }
/** A template method for formatting in a converter specific way. */ public void format(StringBuffer sbuf, LoggingEvent e) { String s = convert(e); if(s == null) { if(0 < min) spacePad(sbuf, min); return; } int len = s.length(); if(len > max) sbuf.append(s.substring(len-max)); else if(len < min) { if(leftAlign) { sbuf.append(s); spacePad(sbuf, min-len); } else { spacePad(sbuf, min-len); sbuf.append(s); } } else sbuf.append(s); }
/** * Formats a logging event to a writer. * @param event logging event to be formatted. */ public String format(final LoggingEvent event) { StringBuffer buf = new StringBuffer(); for(PatternConverter c = head; c != null; c = c.next) { c.format(buf, event); } return buf.toString(); }
/** A template method for formatting in a converter specific way. */ public void format(StringBuffer sbuf, LoggingEvent e) { String s = convert(e); if(s == null) { if(0 < min) spacePad(sbuf, min); return; } int len = s.length(); if(len > max) sbuf.append(s.substring(len-max)); else if(len < min) { if(leftAlign) { sbuf.append(s); spacePad(sbuf, min-len); } else { spacePad(sbuf, min-len); sbuf.append(s); } } else sbuf.append(s); }
/** * Formats a logging event to a writer. * @param event logging event to be formatted. */ public String format(final LoggingEvent event) { StringBuffer buf = new StringBuffer(); for(PatternConverter c = head; c != null; c = c.next) { c.format(buf, event); } return buf.toString(); }
/** A template method for formatting in a converter specific way. */ public void format(StringBuffer sbuf, LoggingEvent e) { String s = convert(e); if(s == null) { if(0 < min) spacePad(sbuf, min); return; } int len = s.length(); if(len > max) sbuf.append(s.substring(len-max)); else if(len < min) { if(leftAlign) { sbuf.append(s); spacePad(sbuf, min-len); } else { spacePad(sbuf, min-len); sbuf.append(s); } } else sbuf.append(s); }
/** * Formats a logging event to a writer. * @param event logging event to be formatted. */ public String format(final LoggingEvent event) { StringBuffer buf = new StringBuffer(); for(PatternConverter c = head; c != null; c = c.next) { c.format(buf, event); } return buf.toString(); }
/** A template method for formatting in a converter specific way. */ public void format(StringBuffer sbuf, LoggingEvent e) { String s = convert(e); if(s == null) { if(0 < min) spacePad(sbuf, min); return; } int len = s.length(); if(len > max) sbuf.append(s.substring(len-max)); else if(len < min) { if(leftAlign) { sbuf.append(s); spacePad(sbuf, min-len); } else { spacePad(sbuf, min-len); sbuf.append(s); } } else sbuf.append(s); }
/** * Formats a logging event to a writer. * @param event logging event to be formatted. */ public String format(final LoggingEvent event) { StringBuffer buf = new StringBuffer(); for(PatternConverter c = head; c != null; c = c.next) { c.format(buf, event); } return buf.toString(); }
/** A template method for formatting in a converter specific way. */ public void format(StringBuffer sbuf, LoggingEvent e) { String s = convert(e); if(s == null) { if(0 < min) spacePad(sbuf, min); return; } int len = s.length(); if(len > max) sbuf.append(s.substring(len-max)); else if(len < min) { if(leftAlign) { sbuf.append(s); spacePad(sbuf, min-len); } else { spacePad(sbuf, min-len); sbuf.append(s); } } else sbuf.append(s); }
/** Produces a formatted string as specified by the conversion pattern. */ public String format(LoggingEvent event) { // Reset working stringbuffer if(sbuf.capacity() > MAX_CAPACITY) { sbuf = new StringBuffer(BUF_SIZE); } else { sbuf.setLength(0); } PatternConverter c = head; while(c != null) { c.format(sbuf, event); c = c.next; } return sbuf.toString(); } }