1 package org.apache.jetspeed.services.logging; 2 17 18 import org.apache.log4j.Level; 20 import org.apache.log4j.LogManager; 21 import org.apache.log4j.Logger; 22 23 32 public class JetspeedLogger 33 { 34 35 38 private Logger logger; 39 40 46 public JetspeedLogger(Logger logger) 47 { 48 if(logger != null) 49 { 50 this.logger = logger; 51 } else 52 { 53 this.logger = LogManager.getLogger(JetspeedLogger.class.getName()); 54 } 55 } 56 57 62 public boolean isDebugEnabled() 63 { 64 return logger.isDebugEnabled(); 65 } 66 67 72 public boolean isErrorEnabled() 73 { 74 return logger.isEnabledFor(Level.ERROR); 75 } 76 77 82 public boolean isFatalEnabled() 83 { 84 return logger.isEnabledFor(Level.FATAL); 85 } 86 87 92 public boolean isInfoEnabled() 93 { 94 return logger.isInfoEnabled(); 95 } 96 97 103 public boolean isTraceEnabled() 104 { 105 return logger.isDebugEnabled(); 106 } 107 108 113 public boolean isWarnEnabled() 114 { 115 return logger.isEnabledFor(Level.WARN); 116 } 117 118 123 public void debug(Object obj) 124 { 125 logger.debug(obj); 126 } 127 128 134 public void debug(Object obj, Throwable throwable) 135 { 136 logger.debug(obj, throwable); 137 } 138 139 144 public void error(Object obj) 145 { 146 logger.error(obj); 147 } 148 149 155 public void error(Object obj, Throwable throwable) 156 { 157 logger.error(obj, throwable); 158 } 159 160 165 public void fatal(Object obj) 166 { 167 logger.fatal(obj); 168 } 169 170 176 public void fatal(Object obj, Throwable throwable) 177 { 178 logger.fatal(obj, throwable); 179 } 180 181 186 public void info(Object obj) 187 { 188 logger.info(obj); 189 } 190 191 197 public void info(Object obj, Throwable throwable) 198 { 199 logger.info(obj, throwable); 200 } 201 202 208 public void trace(Object obj) 209 { 210 logger.debug(obj); 211 } 212 213 220 public void trace(Object obj, Throwable throwable) 221 { 222 logger.debug(obj, throwable); 223 } 224 225 230 public void warn(Object obj) 231 { 232 logger.warn(obj); 233 } 234 235 241 public void warn(Object obj, Throwable throwable) 242 { 243 logger.warn(obj, throwable); 244 } 245 } 247 | Popular Tags |