Mercurial Hosting > luan
annotate src/goodjava/logging/Log4jFactory.java @ 1413:514b7a62fe27
compiler bug
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 06 Oct 2019 22:23:11 -0600 |
parents | 27efb1fcbcb5 |
children | 6fc083e1d08c |
rev | line source |
---|---|
1402
27efb1fcbcb5
move luan.lib to goodjava
Franklin Schmidt <fschmidt@gmail.com>
parents:
1337
diff
changeset
|
1 package goodjava.logging; |
1337 | 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 } |