1 16 17 package org.apache.commons.logging.simple; 18 19 20 import java.util.ArrayList ; 21 import java.util.List ; 22 import java.text.DateFormat ; 23 import org.apache.commons.logging.impl.SimpleLog; 24 25 26 30 31 public class DecoratedSimpleLog extends SimpleLog { 32 33 34 36 37 public DecoratedSimpleLog(String name) { 38 super(name); 39 } 40 41 42 44 public DateFormat getDateTimeFormatter() { 45 return (dateFormatter); 46 } 47 48 49 public String getDateTimeFormat() { 50 return (dateTimeFormat); 51 } 52 53 54 public String getLogName() { 55 return (logName); 56 } 57 58 59 public boolean getShowDateTime() { 60 return (showDateTime); 61 } 62 63 64 public boolean getShowShortName() { 65 return (showShortName); 66 } 67 68 69 71 72 protected void log(int type, Object message, Throwable t) { 74 75 super.log(type, message, t); 76 cache.add(new LogRecord(type, message, t)); 77 78 } 79 80 81 83 84 protected ArrayList cache = new ArrayList (); 86 87 88 public void clearCache() { 90 cache.clear(); 91 } 92 93 94 public List getCache() { 96 return (this.cache); 97 } 98 99 100 } 101 | Popular Tags |