1 24 25 package org.objectweb.cjdbc.common.log; 26 27 import org.apache.log4j.Logger; 28 import org.apache.log4j.Priority; 29 30 37 public class Trace 38 { 39 40 private Logger log4jLogger; 41 42 47 protected Trace(Logger log4jLogger) 48 { 49 this.log4jLogger = log4jLogger; 50 } 51 52 58 public static Trace getLogger(String name) 59 { 60 return LogManager.getLogger(name); 61 } 62 63 68 public void debug(Object message) 69 { 70 log4jLogger.debug(message); 71 } 72 73 81 public void debug(Object message, Throwable error) 82 { 83 log4jLogger.debug(message, error); 84 } 85 86 91 public void error(Object message) 92 { 93 log4jLogger.error(message); 94 } 95 96 104 public void error(Object message, Throwable error) 105 { 106 log4jLogger.error(message, error); 107 } 108 109 114 public void fatal(Object message) 115 { 116 log4jLogger.fatal(message); 117 } 118 119 127 public void fatal(Object message, Throwable error) 128 { 129 log4jLogger.fatal(message, error); 130 } 131 132 137 public void info(Object message) 138 { 139 log4jLogger.info(message); 140 } 141 142 150 public void info(Object message, Throwable error) 151 { 152 log4jLogger.info(message, error); 153 } 154 155 160 public void warn(Object message) 161 { 162 log4jLogger.warn(message); 163 } 164 165 173 public void warn(Object message, Throwable error) 174 { 175 log4jLogger.warn(message, error); 176 } 177 178 217 public boolean isDebugEnabled() 218 { 219 return log4jLogger.isDebugEnabled(); 220 } 221 222 230 public boolean isInfoEnabled() 231 { 232 return log4jLogger.isInfoEnabled(); 233 } 234 235 243 public boolean isWarnEnabled() 244 { 245 return log4jLogger.isEnabledFor(Priority.WARN); 246 } 247 248 256 public boolean isErrorEnabled() 257 { 258 return log4jLogger.isEnabledFor(Priority.ERROR); 259 } 260 261 269 public boolean isFatalEnabled() 270 { 271 return log4jLogger.isEnabledFor(Priority.FATAL); 272 } 273 } 274 | Popular Tags |