1 61 62 package org.logicalcobwebs.logging.impl; 63 64 import org.apache.log.Hierarchy; 65 import org.apache.log.Logger; 66 import org.logicalcobwebs.logging.Log; 67 68 81 82 public final class LogKitLogger implements Log { 83 84 86 87 88 private Logger logger = null; 89 90 91 93 94 100 public LogKitLogger (String name) { 101 logger = Hierarchy.getDefaultHierarchy ().getLoggerFor (name); 102 } 103 104 105 107 108 111 public void trace (Object message) { 112 debug (message); 113 } 114 115 118 public void trace (Object message, Throwable t) { 119 debug (message, t); 120 } 121 122 125 public void debug (Object message) { 126 if (message != null) { 127 logger.debug (String.valueOf (message)); 128 } 129 } 130 131 134 public void debug (Object message, Throwable t) { 135 if (message != null) { 136 logger.debug (String.valueOf (message), t); 137 } 138 } 139 140 143 public void info (Object message) { 144 if (message != null) { 145 logger.info (String.valueOf (message)); 146 } 147 } 148 149 152 public void info (Object message, Throwable t) { 153 if (message != null) { 154 logger.info (String.valueOf (message), t); 155 } 156 } 157 158 161 public void warn (Object message) { 162 if (message != null) { 163 logger.warn (String.valueOf (message)); 164 } 165 } 166 167 170 public void warn (Object message, Throwable t) { 171 if (message != null) { 172 logger.warn (String.valueOf (message), t); 173 } 174 } 175 176 179 public void error (Object message) { 180 if (message != null) { 181 logger.error (String.valueOf (message)); 182 } 183 } 184 185 188 public void error (Object message, Throwable t) { 189 if (message != null) { 190 logger.error (String.valueOf (message), t); 191 } 192 } 193 194 197 public void fatal (Object message) { 198 if (message != null) { 199 logger.fatalError (String.valueOf (message)); 200 } 201 } 202 203 206 public void fatal (Object message, Throwable t) { 207 if (message != null) { 208 logger.fatalError (String.valueOf (message), t); 209 } 210 } 211 212 215 public boolean isDebugEnabled () { 216 return logger.isDebugEnabled (); 217 } 218 219 222 public boolean isErrorEnabled () { 223 return logger.isErrorEnabled (); 224 } 225 226 229 public boolean isFatalEnabled () { 230 return logger.isFatalErrorEnabled (); 231 } 232 233 236 public boolean isInfoEnabled () { 237 return logger.isInfoEnabled (); 238 } 239 240 243 public boolean isTraceEnabled () { 244 return logger.isDebugEnabled (); 245 } 246 247 250 public boolean isWarnEnabled () { 251 return logger.isWarnEnabled (); 252 } 253 254 } 255 256 | Popular Tags |