1 package org.jzonic.jlo.formatter; 2 3 import org.jzonic.jlo.LogRecord; 4 5 import java.util.Map ; 6 16 public class PlainFormatter extends AbstractFormatter { 17 20 public PlainFormatter(String configName) { 21 super(configName); 22 } 23 24 25 29 public String formatMessage(LogRecord lr) { 30 StringBuffer sb = new StringBuffer (); 31 if (lr.getTarget() != null) { 32 sb.append("["); 33 sb.append(lr.getTarget().getName().toUpperCase()); 34 sb.append("] "); 35 } 36 if (lr.getMessage() != null) { 37 sb.append(lr.getMessage()); 38 } 39 if ( lr.getThrown() != null ) { 40 sb.append(":"); 41 sb.append(lr.getThrown().getMessage()); 42 } 43 return sb.toString(); 44 } 45 46 public void setParameter(Map params) { 47 } 49 } 50 | Popular Tags |