ozeigermann    2004/07/01 05:54:34

  Added:       src/share/org/apache/slide/util/logger TxLogger.java
                        LoggerFacade.java
  Log:
  Temporarily introduced yet another logger to prepare migration to commons 
transaction component
  
  Revision  Changes    Path
  1.1                  
jakarta-slide/src/share/org/apache/slide/util/logger/TxLogger.java
  
  Index: TxLogger.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/util/logger/TxLogger.java,v 1.1 
2004/07/01 12:54:34 ozeigermann Exp $
   * $Revision: 1.1 $
   * $Date: 2004/07/01 12:54:34 $
   *
   * ====================================================================
   *
   * Copyright 2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *
   */
  
  package org.apache.slide.util.logger;
  
  /**
   * Default logger implementation. Uses java.util.logging implementation provided
   * by Java 1.4.
   * 
   * @version $Revision: 1.1 $
   */
  public class TxLogger implements LoggerFacade {
  
        protected Logger logger;
  
        protected String logChannel;
  
        public TxLogger(Logger logger, String logChannel) {
                this.logger = logger;
                this.logChannel = logChannel;
        }
  
        public Logger getLogger() {
                return logger;
        }
  
        public LoggerFacade createLogger(String name) {
                return new TxLogger(logger, name);
        }
  
        public void logInfo(String message) {
                logger.log(message, logChannel, Logger.INFO);
        }
  
        public void logFine(String message) {
                logger.log(message, logChannel, Logger.DEBUG);
        }
  
        public boolean isFineEnabled() {
                return logger.isEnabled(logChannel, Logger.DEBUG);
        }
  
        public void logFiner(String message) {
                logger.log(message, logChannel, Logger.DEBUG);
        }
  
        public boolean isFinerEnabled() {
                return logger.isEnabled(logChannel, Logger.DEBUG);
        }
  
        public void logFinest(String message) {
                logger.log(message, logChannel, Logger.DEBUG);
        }
  
        public boolean isFinestEnabled() {
                return logger.isEnabled(logChannel, Logger.DEBUG);
        }
  
        public void logWarning(String message) {
                logger.log(message, logChannel, Logger.WARNING);
        }
  
        public void logWarning(String message, Throwable t) {
                logger.log(message, logChannel, Logger.WARNING);
                logger.log(t, logChannel, Logger.WARNING);
        }
  
        public void logSevere(String message) {
                logger.log(message, logChannel, Logger.EMERGENCY);
        }
  
        public void logSevere(String message, Throwable t) {
                logger.log(message, logChannel, Logger.EMERGENCY);
                logger.log(t, logChannel, Logger.EMERGENCY);
        }
  
  }
  
  
  1.1                  
jakarta-slide/src/share/org/apache/slide/util/logger/LoggerFacade.java
  
  Index: LoggerFacade.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/util/logger/LoggerFacade.java,v 1.1 
2004/07/01 12:54:34 ozeigermann Exp $
   * $Revision: 1.1 $
   * $Date: 2004/07/01 12:54:34 $
   *
   * ====================================================================
   *
   * Copyright 1999-2002 The Apache Software Foundation 
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *
   */
  
  package org.apache.slide.util.logger;
  
  
  /**
   * Facade for all kinds of logging engines.
   *   
   * @version $Revision: 1.1 $
   */
  public interface LoggerFacade {
  
      public LoggerFacade createLogger(String name);
  
      public void logInfo(String message);
      public void logFine(String message);
      public boolean isFineEnabled();
      public void logFiner(String message);
      public boolean isFinerEnabled();
      public void logFinest(String message);
      public boolean isFinestEnabled();
      public void logWarning(String message);
      public void logWarning(String message, Throwable t);
      public void logSevere(String message);
      public void logSevere(String message, Throwable t);
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to