1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.ibatis.logging.slf4j;
17
18 import org.apache.ibatis.logging.Log;
19 import org.apache.ibatis.logging.LogFactory;
20 import org.slf4j.Marker;
21 import org.slf4j.MarkerFactory;
22 import org.slf4j.spi.LocationAwareLogger;
23
24
25
26
27 class Slf4jLocationAwareLoggerImpl implements Log {
28
29 private static final Marker MARKER = MarkerFactory.getMarker(LogFactory.MARKER);
30
31 private static final String FQCN = Slf4jImpl.class.getName();
32
33 private final LocationAwareLogger logger;
34
35 Slf4jLocationAwareLoggerImpl(LocationAwareLogger logger) {
36 this.logger = logger;
37 }
38
39 @Override
40 public boolean isDebugEnabled() {
41 return logger.isDebugEnabled();
42 }
43
44 @Override
45 public boolean isTraceEnabled() {
46 return logger.isTraceEnabled();
47 }
48
49 @Override
50 public void error(String s, Throwable e) {
51 logger.log(MARKER, FQCN, LocationAwareLogger.ERROR_INT, s, null, e);
52 }
53
54 @Override
55 public void error(String s) {
56 logger.log(MARKER, FQCN, LocationAwareLogger.ERROR_INT, s, null, null);
57 }
58
59 @Override
60 public void debug(String s) {
61 logger.log(MARKER, FQCN, LocationAwareLogger.DEBUG_INT, s, null, null);
62 }
63
64 @Override
65 public void trace(String s) {
66 logger.log(MARKER, FQCN, LocationAwareLogger.TRACE_INT, s, null, null);
67 }
68
69 @Override
70 public void warn(String s) {
71 logger.log(MARKER, FQCN, LocationAwareLogger.WARN_INT, s, null, null);
72 }
73
74 }