avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: jakarta-avalon/src/java/org/apache/avalon/framework/logger Jdk14Logger.java AvalonFormatter.java Log4JLogger.java
Date Wed, 31 Oct 2001 16:58:32 GMT
bloritsch    01/10/31 08:58:32

  Modified:    .        build.xml
               src/java/org/apache/avalon/framework/logger
                        AvalonFormatter.java Log4JLogger.java
  Added:       src/java/org/apache/avalon/framework/logger Jdk14Logger.java
  Log:
  0 deprecation warnings, and JDK1.4 logger adaptor
  
  Revision  Changes    Path
  1.100     +5 -0      jakarta-avalon/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/build.xml,v
  retrieving revision 1.99
  retrieving revision 1.100
  diff -u -r1.99 -r1.100
  --- build.xml	2001/10/31 15:45:50	1.99
  +++ build.xml	2001/10/31 16:58:32	1.100
  @@ -129,6 +129,9 @@
       <available property="log4j.present" classname="org.apache.log4j.Category">
         <classpath refid="project.class.path"/>
       </available>
  +    <available property="jdk14.present" classname="java.util.logging.Logger">
  +      <classpath refid="project.class.path"/>
  +    </available>
   
       <property name="dist.dir" value="dist"/>
       <property name="dist.bin" value="${dist.dir}/bin"/>
  @@ -165,6 +168,8 @@
         <src path="${test.dir}"/>
         <exclude name="org/apache/avalon/framework/logger/Log4JLogger.java"
                  unless="log4j.present"/>
  +      <exclude name="org/apache/avalon/framework/logger/Jdk14Logger.java"
  +               unless="jdk14.present"/>
       </javac>
     </target>
   
  
  
  
  1.6       +2 -9      jakarta-avalon/src/java/org/apache/avalon/framework/logger/AvalonFormatter.java
  
  Index: AvalonFormatter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/logger/AvalonFormatter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AvalonFormatter.java	2001/08/16 04:11:43	1.5
  +++ AvalonFormatter.java	2001/10/31 16:58:32	1.6
  @@ -12,21 +12,14 @@
   import org.apache.log.format.PatternFormatter;
   
   /**
  - * This formatter extends PatternFormatter so that 
  + * This formatter extends PatternFormatter so that
    * CascadingExceptions are formatted with all nested exceptions.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    */
  -public class AvalonFormatter 
  +public class AvalonFormatter
       extends PatternFormatter
   {
  -    /**
  -     * @deprecated Use Constructor that passes in pattern as setFormat is deprecated.
  -     */
  -    public AvalonFormatter()
  -    {
  -    }
  -
       public AvalonFormatter( final String pattern )
       {
           super( pattern );
  
  
  
  1.2       +1 -1      jakarta-avalon/src/java/org/apache/avalon/framework/logger/Log4JLogger.java
  
  Index: Log4JLogger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/logger/Log4JLogger.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Log4JLogger.java	2001/10/31 15:45:50	1.1
  +++ Log4JLogger.java	2001/10/31 16:58:32	1.2
  @@ -11,7 +11,7 @@
   import org.apache.log4j.Priority;
   
   /**
  - * The default LogKit wrapper class for Logger.
  + * The default Log4J wrapper class for Logger.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    */
  
  
  
  1.1                  jakarta-avalon/src/java/org/apache/avalon/framework/logger/Jdk14Logger.java
  
  Index: Jdk14Logger.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.avalon.framework.logger;
  
  import java.util.logging.Level;
  
  /**
   * The default JDK 1.4 wrapper class for Logger.  Please note that there is
   * not an exact match to the priority levels that JDK 1.4 logging has and
   * what LogKit or Log4J has.  For that reason, the following priority level
   * matching was used:
   *
   * <ul>
   *   <li>SEVERE  = error, fatalError</li>
   *   <li>WARNING = warn</li>
   *   <li>INFO    = info</li>
   *   <li>FINE    = debug</li>
   * </ul>
   *
   * <p>
   *   JDK 1.4 does allow you to have other levels like: CONFIG, FINER, and
   *   FINEST.  Most projects don't separate out configuration logging from
   *   debugging information.  Also, we wanted to maintain backwards
   *   compatibility as much as possible.  Unfortunately, with all the "fineness"
   *   details, there is no equivalent to the "error" log level.
   * </p>
   *
   * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
   */
  public final class Jdk14Logger implements Logger
  {
      private final java.util.logging.Logger m_logger;
  
      public Jdk14Logger( java.util.logging.Logger logImpl )
      {
          m_logger = logImpl;
      }
  
      public final void debug( final String message )
      {
          m_logger.log( Level.FINE, message );
      }
  
      public final void debug( final String message, final Throwable throwable )
      {
          m_logger.log( Level.FINE, message, throwable );
      }
  
      public final boolean isDebugEnabled()
      {
          return m_logger.isLoggable( Level.FINE );
      }
  
      public final void info( final String message )
      {
          m_logger.log( Level.INFO, message );
      }
  
      public final void info( final String message, final Throwable throwable )
      {
          m_logger.log( Level.INFO, message, throwable );
      }
  
      public final boolean isInfoEnabled()
      {
          return m_logger.isLoggable( Level.INFO );
      }
  
      public final void warn( final String message )
      {
          m_logger.log( Level.WARNING, message );
      }
  
      public final void warn( final String message, final Throwable throwable )
      {
          m_logger.log( Level.WARNING, message, throwable );
      }
  
      public final boolean isWarnEnabled()
      {
          return m_logger.isLoggable( Level.WARNING );
      }
  
      public final void error( final String message )
      {
          m_logger.log( Level.SEVERE, message );
      }
  
      public final void error( final String message, final Throwable throwable )
      {
          m_logger.log( Level.SEVERE, message, throwable );
      }
  
      public final boolean isErrorEnabled()
      {
          return m_logger.isLoggable( Level.SEVERE );
      }
  
      public final void fatalError( final String message )
      {
          m_logger.log( Level.SEVERE, message );
      }
  
      public final void fatalError( final String message, final Throwable throwable )
      {
          m_logger.log( Level.SEVERE, message, throwable );
      }
  
      public final boolean isFatalErrorEnabled()
      {
          return m_logger.isLoggable( Level.SEVERE );
      }
  
      public final Logger getChildLogger( final String name )
      {
          return new Log4JLogger( Logger.getLogger( m_logger.getName() + "." + name ) );
      }
  }
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message