001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.cocoon.portal.pluto.service.log;
018:
019: import org.apache.avalon.framework.logger.Logger;
020:
021: /**
022: * Our own log service logging to an avalon logger
023: *
024: * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
025: *
026: * @version CVS $Id: LoggerImpl.java 433543 2006-08-22 06:22:54Z crossley $
027: */
028: public class LoggerImpl implements org.apache.pluto.services.log.Logger {
029:
030: /** The logger to use */
031: protected Logger logger;
032:
033: /** Constructor */
034: public LoggerImpl(Logger logger) {
035: this .logger = logger;
036: }
037:
038: /* (non-Javadoc)
039: * @see org.apache.pluto.services.log.LogService#debug(java.lang.String, java.lang.String, java.lang.Throwable)
040: */
041: public void debug(String aMessage, Throwable aThrowable) {
042: this .logger.debug(aMessage, aThrowable);
043: }
044:
045: /* (non-Javadoc)
046: * @see org.apache.pluto.services.log.LogService#debug(java.lang.String, java.lang.String)
047: */
048: public void debug(String aMessage) {
049: this .logger.debug(aMessage);
050: }
051:
052: /* (non-Javadoc)
053: * @see org.apache.pluto.services.log.LogService#error(java.lang.String, java.lang.String, java.lang.Throwable)
054: */
055: public void error(String aMessage, Throwable aThrowable) {
056: this .logger.error(aMessage, aThrowable);
057: }
058:
059: /* (non-Javadoc)
060: * @see org.apache.pluto.services.log.LogService#info(java.lang.String, java.lang.String)
061: */
062: public void info(String aMessage) {
063: this .logger.info(aMessage);
064: }
065:
066: /* (non-Javadoc)
067: * @see org.apache.pluto.services.log.LogService#isDebugEnabled(java.lang.String)
068: */
069: public boolean isDebugEnabled() {
070: return this .logger.isDebugEnabled();
071: }
072:
073: /* (non-Javadoc)
074: * @see org.apache.pluto.services.log.LogService#isErrorEnabled(java.lang.String)
075: */
076: public boolean isErrorEnabled() {
077: return this .logger.isErrorEnabled();
078: }
079:
080: /* (non-Javadoc)
081: * @see org.apache.pluto.services.log.LogService#isInfoEnabled(java.lang.String)
082: */
083: public boolean isInfoEnabled() {
084: return this .logger.isInfoEnabled();
085: }
086:
087: /* (non-Javadoc)
088: * @see org.apache.pluto.services.log.LogService#isWarnEnabled(java.lang.String)
089: */
090: public boolean isWarnEnabled() {
091: return this .logger.isWarnEnabled();
092: }
093:
094: /* (non-Javadoc)
095: * @see org.apache.pluto.services.log.LogService#warn(java.lang.String, java.lang.String)
096: */
097: public void warn(String aMessage) {
098: this .logger.warn(aMessage);
099: }
100:
101: /* (non-Javadoc)
102: * @see org.apache.pluto.services.log.Logger#error(java.lang.Throwable)
103: */
104: public void error(Throwable throwable) {
105: this .logger.error("Exception", throwable);
106: }
107:
108: /* (non-Javadoc)
109: * @see org.apache.pluto.services.log.Logger#error(java.lang.String)
110: */
111: public void error(String aMessage) {
112: this.logger.error(aMessage);
113: }
114: }
|