Home » geronimo-2.2-source-release » org.apache.geronimo.kernel.log » [javadoc | source]

    1   /**
    2    *
    3    * Copyright 2003-2004 The Apache Software Foundation
    4    *
    5    *  Licensed under the Apache License, Version 2.0 (the "License");
    6    *  you may not use this file except in compliance with the License.
    7    *  You may obtain a copy of the License at
    8    *
    9    *     http://www.apache.org/licenses/LICENSE-2.0
   10    *
   11    *  Unless required by applicable law or agreed to in writing, software
   12    *  distributed under the License is distributed on an "AS IS" BASIS,
   13    *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    *  See the License for the specific language governing permissions and
   15    *  limitations under the License.
   16    */
   17   
   18   package org.apache.geronimo.kernel.log;
   19   
   20   import org.apache.commons.logging.Log;
   21   
   22   /**
   23    * This log wrapper caches the trace, debug and info enabled flags.  The flags are updated
   24    * by a single timer task for all logs.
   25    *
   26    * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
   27    */
   28   public final class GeronimoLog implements Log {
   29       private final String name;
   30       private Log log;
   31   
   32       public GeronimoLog(String name, Log log) {
   33           this.name = name;
   34           this.log = log;
   35       }
   36   
   37       public String getName() {
   38           return name;
   39       }
   40   
   41       public Log getLog() {
   42           return log;
   43       }
   44   
   45       public void setLog(Log log) {
   46           this.log = log;
   47       }
   48   
   49       public boolean isTraceEnabled() {
   50           return log.isTraceEnabled();
   51       }
   52   
   53       public void trace(Object message) {
   54           log.trace(message);
   55       }
   56   
   57       public void trace(Object message, Throwable throwable) {
   58           log.trace(message, throwable);
   59       }
   60   
   61       public boolean isDebugEnabled() {
   62           return log.isDebugEnabled();
   63       }
   64   
   65       public void debug(Object message) {
   66           log.debug(message);
   67       }
   68   
   69       public void debug(Object message, Throwable throwable) {
   70           log.debug(message, throwable);
   71       }
   72   
   73       public boolean isInfoEnabled() {
   74           return log.isInfoEnabled();
   75       }
   76   
   77       public void info(Object message) {
   78           log.info(message);
   79       }
   80   
   81       public void info(Object message, Throwable throwable) {
   82           log.info(message, throwable);
   83       }
   84   
   85       public boolean isWarnEnabled() {
   86           return log.isWarnEnabled();
   87       }
   88   
   89       public void warn(Object message) {
   90           log.warn(message);
   91       }
   92   
   93       public void warn(Object message, Throwable throwable) {
   94           log.warn(message, throwable);
   95       }
   96   
   97       public boolean isErrorEnabled() {
   98           return log.isErrorEnabled();
   99       }
  100   
  101       public void error(Object message) {
  102           log.error(message);
  103       }
  104   
  105       public void error(Object message, Throwable throwable) {
  106           log.error(message, throwable);
  107       }
  108   
  109       public boolean isFatalEnabled() {
  110           return log.isFatalEnabled();
  111       }
  112   
  113       public void fatal(Object message) {
  114           log.fatal(message);
  115       }
  116   
  117       public void fatal(Object message, Throwable throwable) {
  118           log.fatal(message, throwable);
  119       }
  120   }

Home » geronimo-2.2-source-release » org.apache.geronimo.kernel.log » [javadoc | source]