1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.mybatis.logging;
17
18 import java.util.function.Supplier;
19
20 import org.apache.ibatis.logging.Log;
21
22
23
24
25
26
27 public class Logger {
28
29 private final Log log;
30
31 Logger(Log log) {
32 this.log = log;
33 }
34
35 public void error(Supplier<String> s, Throwable e) {
36 log.error(s.get(), e);
37 }
38
39 public void error(Supplier<String> s) {
40 log.error(s.get());
41 }
42
43 public void warn(Supplier<String> s) {
44 log.warn(s.get());
45 }
46
47 public void debug(Supplier<String> s) {
48 if (log.isDebugEnabled()) {
49 log.debug(s.get());
50 }
51 }
52
53 public void trace(Supplier<String> s) {
54 if (log.isTraceEnabled()) {
55 log.trace(s.get());
56 }
57 }
58
59 }