1 19 20 package common.log; 21 22 import org.apache.log4j.Logger; 23 24 28 public class Log4JLogger extends common.Logger 29 { 30 33 private Logger log4jLogger; 34 35 38 public Log4JLogger() 39 { 40 super(); 41 } 42 43 47 private Log4JLogger(Logger l) 48 { 49 super(); 50 log4jLogger = l; 51 } 52 53 56 public void debug(Object message) 57 { 58 log4jLogger.debug(message); 59 } 60 61 64 public void debug(Object message, Throwable t) 65 { 66 log4jLogger.debug(message, t); 67 } 68 69 72 public void error(Object message) 73 { 74 log4jLogger.error(message); 75 } 76 77 80 public void error(Object message, Throwable t) 81 { 82 log4jLogger.error(message, t); 83 } 84 85 88 public void fatal(Object message) 89 { 90 log4jLogger.fatal(message); 91 } 92 93 96 public void fatal(Object message, Throwable t) 97 { 98 log4jLogger.fatal(message,t); 99 } 100 101 104 public void info(Object message) 105 { 106 log4jLogger.info(message); 107 } 108 109 112 113 public void info(Object message, Throwable t) 114 { 115 log4jLogger.info(message, t); 116 } 117 118 121 public void warn(Object message) 122 { 123 log4jLogger.warn(message); 124 } 125 126 129 public void warn(Object message, Throwable t) 130 { 131 log4jLogger.warn(message, t); 132 } 133 134 137 protected common.Logger getLoggerImpl(Class cl) 138 { 139 Logger l = Logger.getLogger(cl); 140 return new Log4JLogger(l); 141 } 142 } 143 | Popular Tags |