1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jboss.netty.logging;
17
18 import org.apache.commons.logging.Log;
19
20
21
22
23
24 class CommonsLogger extends AbstractInternalLogger {
25
26 private final Log logger;
27 private final String loggerName;
28
29 CommonsLogger(Log logger, String loggerName) {
30 this.logger = logger;
31 this.loggerName = loggerName;
32 }
33
34 public void debug(String msg) {
35 logger.debug(msg);
36 }
37
38 public void debug(String msg, Throwable cause) {
39 logger.debug(msg, cause);
40 }
41
42 public void error(String msg) {
43 logger.error(msg);
44 }
45
46 public void error(String msg, Throwable cause) {
47 logger.error(msg, cause);
48 }
49
50 public void info(String msg) {
51 logger.info(msg);
52 }
53
54 public void info(String msg, Throwable cause) {
55 logger.info(msg, cause);
56 }
57
58 public boolean isDebugEnabled() {
59 return logger.isDebugEnabled();
60 }
61
62 public boolean isErrorEnabled() {
63 return logger.isErrorEnabled();
64 }
65
66 public boolean isInfoEnabled() {
67 return logger.isInfoEnabled();
68 }
69
70 public boolean isWarnEnabled() {
71 return logger.isWarnEnabled();
72 }
73
74 public void warn(String msg) {
75 logger.warn(msg);
76 }
77
78 public void warn(String msg, Throwable cause) {
79 logger.warn(msg, cause);
80 }
81
82 @Override
83 public String toString() {
84 return loggerName;
85 }
86 }