1 3 package org.apache.commons.logging.impl; 4 5 import org.apache.commons.logging.Log; 6 import org.slf4j.Logger; 7 import org.slf4j.spi.LocationAwareLogger; 8 9 18 public class SLF4JLocationAwareLog implements Log { 19 20 private LocationAwareLogger logger; 21 private static final String FQCN = SLF4JLocationAwareLog.class.getName(); 22 23 SLF4JLocationAwareLog(LocationAwareLogger logger) { 24 this.logger = logger; 25 } 26 27 30 public boolean isDebugEnabled() { 31 return logger.isDebugEnabled(); 32 } 33 34 37 public boolean isErrorEnabled() { 38 return logger.isErrorEnabled(); 39 } 40 41 45 public boolean isFatalEnabled() { 46 return logger.isErrorEnabled(); 47 } 48 49 52 public boolean isInfoEnabled() { 53 return logger.isInfoEnabled(); 54 } 55 56 60 public boolean isTraceEnabled() { 61 return logger.isTraceEnabled(); 62 } 63 64 67 public boolean isWarnEnabled() { 68 return logger.isWarnEnabled(); 69 } 70 71 77 public void trace(Object message) { 78 logger.log(null, FQCN, LocationAwareLogger.TRACE_INT, String.valueOf(message), null); 79 } 80 81 88 public void trace(Object message, Throwable t) { 89 logger.log(null, FQCN, LocationAwareLogger.TRACE_INT, String.valueOf(message), t); 90 } 91 92 98 public void debug(Object message) { 99 logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, String.valueOf(message), null); 100 } 101 102 109 public void debug(Object message, Throwable t) { 110 logger.log(null, FQCN, LocationAwareLogger.DEBUG_INT, String.valueOf(message), t); 111 } 112 113 119 public void info(Object message) { 120 logger.log(null, FQCN, LocationAwareLogger.INFO_INT, String.valueOf(message), null); 121 } 122 123 130 public void info(Object message, Throwable t) { 131 logger.log(null, FQCN, LocationAwareLogger.INFO_INT, String.valueOf(message), t); 132 } 133 134 140 public void warn(Object message) { 141 logger.log(null, FQCN, LocationAwareLogger.WARN_INT, String.valueOf(message), null); 142 } 143 144 151 public void warn(Object message, Throwable t) { 152 logger.log(null, FQCN, LocationAwareLogger.WARN_INT, String.valueOf(message), t); 153 } 154 155 161 public void error(Object message) { 162 logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String.valueOf(message), null); 163 } 164 165 172 public void error(Object message, Throwable t) { 173 logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String.valueOf(message), t); 174 } 175 176 177 178 184 public void fatal(Object message) { 185 logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String.valueOf(message), null); 186 } 187 188 195 public void fatal(Object message, Throwable t) { 196 logger.log(null, FQCN, LocationAwareLogger.ERROR_INT, String.valueOf(message), t); 197 } 198 199 } | Popular Tags |