01: /*******************************************************************************
02: * Portions created by Sebastian Thomschke are copyright (c) 2005-2007 Sebastian
03: * Thomschke.
04: *
05: * All Rights Reserved. This program and the accompanying materials
06: * are made available under the terms of the Eclipse Public License v1.0
07: * which accompanies this distribution, and is available at
08: * http://www.eclipse.org/legal/epl-v10.html
09: *
10: * Contributors:
11: * Sebastian Thomschke - initial implementation.
12: *******************************************************************************/package net.sf.oval.logging;
13:
14: import org.apache.commons.logging.Log;
15: import org.apache.commons.logging.LogFactory;
16:
17: /**
18: * Commons Logging Wrapper
19: * @author Sebastian Thomschke
20: */
21: public class LoggerJCLImpl implements Logger {
22: private final Log log;
23:
24: public LoggerJCLImpl(final String name) {
25: if (name == null)
26: throw new IllegalArgumentException("name cannot be null");
27:
28: log = LogFactory.getLog(name);
29: }
30:
31: public void debug(final String msg) {
32: log.debug(msg);
33: }
34:
35: public void debug(final String msg, final Throwable t) {
36: log.debug(msg, t);
37: }
38:
39: public void error(final String msg) {
40: log.error(msg);
41: }
42:
43: public void error(final String msg, final Throwable t) {
44: log.error(msg, t);
45: }
46:
47: public void info(final String msg) {
48: log.info(msg);
49: }
50:
51: public void info(final String msg, final Throwable t) {
52: log.info(msg, t);
53: }
54:
55: public boolean isDebug() {
56: return log.isDebugEnabled();
57: }
58:
59: public boolean isError() {
60: return log.isErrorEnabled();
61: }
62:
63: public boolean isInfo() {
64: return log.isInfoEnabled();
65: }
66:
67: public boolean isTrace() {
68: return log.isTraceEnabled();
69: }
70:
71: public boolean isWarn() {
72: return log.isWarnEnabled();
73: }
74:
75: public void trace(final String msg) {
76: log.trace(msg);
77: }
78:
79: public void trace(final String msg, final Throwable t) {
80: log.trace(msg, t);
81: }
82:
83: public void warn(final String msg) {
84: log.warn(msg);
85: }
86:
87: public void warn(final String msg, final Throwable t) {
88: log.warn(msg, t);
89: }
90: }
|