comparison src/goodjava/logging/Slf4jFactory.java @ 1452:c15444f4da05

Slf4jFactory
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 01 Mar 2020 16:05:26 -0700
parents
children
comparison
equal deleted inserted replaced
1451:85d7c1777357 1452:c15444f4da05
1 package goodjava.logging;
2
3
4 public final class Slf4jFactory implements ILoggerFactory {
5 private static final class Slf4jLogger implements Logger {
6 final org.slf4j.Logger slf4j;
7
8 Slf4jLogger(org.slf4j.Logger slf4j) {
9 this.slf4j = slf4j;
10 }
11
12 @Override public void error(String msg) {
13 slf4j.error(msg);
14 }
15
16 @Override public void error(String msg,Throwable t) {
17 slf4j.error(msg,t);
18 }
19
20 @Override public void warn(String msg) {
21 slf4j.warn(msg);
22 }
23
24 @Override public void warn(String msg,Throwable t) {
25 slf4j.warn(msg,t);
26 }
27
28 @Override public void info(String msg) {
29 slf4j.info(msg);
30 }
31
32 @Override public void info(String msg,Throwable t) {
33 slf4j.info(msg,t);
34 }
35
36 @Override public boolean isInfoEnabled() {
37 return slf4j.isInfoEnabled();
38 }
39
40 @Override public void debug(String msg) {
41 slf4j.debug(msg);
42 }
43
44 @Override public void debug(String msg,Throwable t) {
45 slf4j.debug(msg,t);
46 }
47
48 @Override public boolean isDebugEnabled() {
49 return slf4j.isDebugEnabled();
50 }
51 }
52
53 @Override public Logger getLogger(String name) {
54 return new Slf4jLogger(org.slf4j.LoggerFactory.getLogger(name));
55 }
56 }