Mercurial Hosting > luan
annotate src/goodjava/logging/Log4jFactory.java @ 1450:28b1ddacfad3
logger work
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 01 Mar 2020 13:47:02 -0700 |
parents | 6fc083e1d08c |
children |
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 | |
1448 | 4 public final class Log4jFactory implements ILoggerFactory { |
1337 | 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 | |
1448 | 36 @Override public boolean isInfoEnabled() { |
37 return log4j.isInfoEnabled(); | |
38 } | |
39 | |
1337 | 40 @Override public void debug(String msg) { |
41 log4j.debug(msg); | |
42 } | |
43 | |
44 @Override public void debug(String msg,Throwable t) { | |
45 log4j.debug(msg,t); | |
46 } | |
1448 | 47 |
48 @Override public boolean isDebugEnabled() { | |
49 return log4j.isDebugEnabled(); | |
50 } | |
1337 | 51 } |
52 | |
1448 | 53 @Override public Logger getLogger(String name) { |
1337 | 54 return new Log4jLogger(org.apache.log4j.Logger.getLogger(name)); |
55 } | |
56 } |