comparison src/goodjava/logging/Log4jFactory.java @ 1402:27efb1fcbcb5

move luan.lib to goodjava
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 17 Sep 2019 01:35:01 -0400
parents src/luan/lib/logging/Log4jFactory.java@8b61c8c4e07a
children 6fc083e1d08c
comparison
equal deleted inserted replaced
1401:ef1620aa99cb 1402:27efb1fcbcb5
1 package goodjava.logging;
2
3
4 public final class Log4jFactory extends LoggerFactory {
5 private static final class Log4jLogger implements Logger {
6 final org.apache.log4j.Logger log4j;
7
8 Log4jLogger(org.apache.log4j.Logger log4j) {
9 this.log4j = log4j;
10 }
11
12 @Override public void error(String msg) {
13 log4j.error(msg);
14 }
15
16 @Override public void error(String msg,Throwable t) {
17 log4j.error(msg,t);
18 }
19
20 @Override public void warn(String msg) {
21 log4j.warn(msg);
22 }
23
24 @Override public void warn(String msg,Throwable t) {
25 log4j.warn(msg,t);
26 }
27
28 @Override public void info(String msg) {
29 log4j.info(msg);
30 }
31
32 @Override public void info(String msg,Throwable t) {
33 log4j.info(msg,t);
34 }
35
36 @Override public void debug(String msg) {
37 log4j.debug(msg);
38 }
39
40 @Override public void debug(String msg,Throwable t) {
41 log4j.debug(msg,t);
42 }
43 }
44
45 @Override protected Logger getLoggerImpl(Class cls) {
46 return new Log4jLogger(org.apache.log4j.Logger.getLogger(cls));
47 }
48
49 @Override protected Logger getLoggerImpl(String name) {
50 return new Log4jLogger(org.apache.log4j.Logger.getLogger(name));
51 }
52 }