1 24 25 package org.objectweb.tribe.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 48 protected Trace(Logger log4jLogger) 49 { 50 this.log4jLogger = log4jLogger; 51 } 52 53 59 public static Trace getLogger(String name) 60 { 61 return LogManager.getLogger(name); 62 } 63 64 69 public void debug(Object message) 70 { 71 log4jLogger.debug(message); 72 } 73 74 82 public void debug(Object message, Throwable error) 83 { 84 log4jLogger.debug(message, error); 85 } 86 87 92 public void error(Object message) 93 { 94 log4jLogger.error(message); 95 } 96 97 105 public void error(Object message, Throwable error) 106 { 107 log4jLogger.error(message, error); 108 } 109 110 115 public void fatal(Object message) 116 { 117 log4jLogger.fatal(message); 118 } 119 120 128 public void fatal(Object message, Throwable error) 129 { 130 log4jLogger.fatal(message, error); 131 } 132 133 138 public void info(Object message) 139 { 140 log4jLogger.info(message); 141 } 142 143 151 public void info(Object message, Throwable error) 152 { 153 log4jLogger.info(message, error); 154 } 155 156 161 public void warn(Object message) 162 { 163 log4jLogger.warn(message); 164 } 165 166 174 public void warn(Object message, Throwable error) 175 { 176 log4jLogger.warn(message, error); 177 } 178 179 214 public boolean isDebugEnabled() 215 { 216 return log4jLogger.isDebugEnabled(); 217 } 218 219 228 public boolean isInfoEnabled() 229 { 230 return log4jLogger.isInfoEnabled(); 231 } 232 233 242 public boolean isWarnEnabled() 243 { 244 return log4jLogger.isEnabledFor(Priority.WARN); 245 } 246 247 256 public boolean isErrorEnabled() 257 { 258 return log4jLogger.isEnabledFor(Priority.ERROR); 259 } 260 261 270 public boolean isFatalEnabled() 271 { 272 return log4jLogger.isEnabledFor(Priority.FATAL); 273 } 274 } | Popular Tags |