001: /*
002: * This file is part of PFIXCORE.
003: *
004: * PFIXCORE is free software; you can redistribute it and/or modify
005: * it under the terms of the GNU Lesser General Public License as published by
006: * the Free Software Foundation; either version 2 of the License, or
007: * (at your option) any later version.
008: *
009: * PFIXCORE is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public License
015: * along with PFIXCORE; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: */
018:
019: package de.schlund.pfixxml.util.logging;
020:
021: import org.apache.commons.logging.Log;
022:
023: import de.schlund.pfixxml.util.logging.ProxyLogUtil.Level;
024:
025: /**
026: * Logger for commons-logging that logs through ProxyLogUtil.
027: * Created by {@link de.schlund.pfixxml.util.logging.ProxyLogFactory}
028: *
029: * @see de.schlund.pfixxml.util.logging.ProxyLogFactory
030: * @see de.schlund.pfixxml.util.logging.ProxyLogUtil
031: * @author Sebastian Marsching <sebastian.marsching@1und1.de>
032: */
033: public class ProxyLogObject implements Log {
034:
035: private String name;
036: private ProxyLogUtil factory = ProxyLogUtil.getInstance();
037:
038: public ProxyLogObject(String name) {
039: this .name = name;
040: }
041:
042: public boolean isDebugEnabled() {
043: return factory.doCheckEnabledCl(name, Level.DEBUG);
044: }
045:
046: public boolean isErrorEnabled() {
047: return factory.doCheckEnabledCl(name, Level.ERROR);
048: }
049:
050: public boolean isFatalEnabled() {
051: return factory.doCheckEnabledCl(name, Level.FATAL);
052: }
053:
054: public boolean isInfoEnabled() {
055: return factory.doCheckEnabledCl(name, Level.INFO);
056: }
057:
058: public boolean isTraceEnabled() {
059: return factory.doCheckEnabledCl(name, Level.TRACE);
060: }
061:
062: public boolean isWarnEnabled() {
063: return factory.doCheckEnabledCl(name, Level.WARN);
064: }
065:
066: public void trace(Object msg) {
067: factory.doLogCl(name, Level.TRACE, msg);
068: }
069:
070: public void trace(Object msg, Throwable e) {
071: factory.doLogCl(name, Level.TRACE, msg, e);
072: }
073:
074: public void debug(Object msg) {
075: factory.doLogCl(name, Level.DEBUG, msg);
076: }
077:
078: public void debug(Object msg, Throwable e) {
079: factory.doLogCl(name, Level.DEBUG, msg, e);
080: }
081:
082: public void info(Object msg) {
083: factory.doLogCl(name, Level.INFO, msg);
084: }
085:
086: public void info(Object msg, Throwable e) {
087: factory.doLogCl(name, Level.INFO, msg, e);
088: }
089:
090: public void warn(Object msg) {
091: factory.doLogCl(name, Level.WARN, msg);
092: }
093:
094: public void warn(Object msg, Throwable e) {
095: factory.doLogCl(name, Level.WARN, msg, e);
096: }
097:
098: public void error(Object msg) {
099: factory.doLogCl(name, Level.ERROR, msg);
100: }
101:
102: public void error(Object msg, Throwable e) {
103: factory.doLogCl(name, Level.ERROR, msg, e);
104: }
105:
106: public void fatal(Object msg) {
107: factory.doLogCl(name, Level.FATAL, msg);
108: }
109:
110: public void fatal(Object msg, Throwable e) {
111: factory.doLogCl(name, Level.FATAL, msg, e);
112: }
113: }
|