avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon/src/java/org/apache/avalon/framework/logger Jdk14Logger.java Log4JLogger.java LogEnabled.java LogKitLogger.java Logger.java
Date Sat, 03 Nov 2001 04:16:11 GMT
donaldp     01/11/02 20:16:11

  Modified:    src/java/org/apache/avalon/framework/logger Jdk14Logger.java
                        Log4JLogger.java LogEnabled.java LogKitLogger.java
                        Logger.java
  Log:
  Add boiler-plate javadoc to all new logging classes.
  
  Revision  Changes    Path
  1.4       +98 -2     jakarta-avalon/src/java/org/apache/avalon/framework/logger/Jdk14Logger.java
  
  Index: Jdk14Logger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/logger/Jdk14Logger.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Jdk14Logger.java	2001/11/02 20:55:26	1.3
  +++ Jdk14Logger.java	2001/11/03 04:16:11	1.4
  @@ -31,94 +31,190 @@
    * </p>
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  + * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
    */
  -public final class Jdk14Logger implements Logger
  +public final class Jdk14Logger 
  +    implements Logger
   {
  +    //The actual JDK1.4 logger implementation
       private final java.util.logging.Logger m_logger;
   
  +    /**
  +     * Construct a Logger with specified jdk1.4 logger instance as implementation.
  +     *
  +     * @param logImpl the jdk1.4 logger instance to delegate to
  +     */
       public Jdk14Logger( java.util.logging.Logger logImpl )
       {
           m_logger = logImpl;
       }
   
  +    /**
  +     * Log a debug message.
  +     *
  +     * @param message the message
  +     */
       public final void debug( final String message )
       {
           m_logger.log( Level.FINE, message );
       }
   
  +    /**
  +     * Log a debug message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       public final void debug( final String message, final Throwable throwable )
       {
           m_logger.log( Level.FINE, message, throwable );
       }
   
  +    /**
  +     * Determine if messages of priority "debug" will be logged.
  +     *
  +     * @return true if "debug" messages will be logged
  +     */
       public final boolean isDebugEnabled()
       {
           return m_logger.isLoggable( Level.FINE );
       }
   
  +    /**
  +     * Log a info message.
  +     *
  +     * @param message the message
  +     */
       public final void info( final String message )
       {
           m_logger.log( Level.INFO, message );
       }
   
  +    /**
  +     * Log a info message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       public final void info( final String message, final Throwable throwable )
       {
           m_logger.log( Level.INFO, message, throwable );
       }
   
  +    /**
  +     * Determine if messages of priority "info" will be logged.
  +     *
  +     * @return true if "info" messages will be logged
  +     */
       public final boolean isInfoEnabled()
       {
           return m_logger.isLoggable( Level.INFO );
       }
   
  +    /**
  +     * Log a warn message.
  +     *
  +     * @param message the message
  +     */
       public final void warn( final String message )
       {
           m_logger.log( Level.WARNING, message );
       }
   
  +    /**
  +     * Log a warn message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       public final void warn( final String message, final Throwable throwable )
       {
           m_logger.log( Level.WARNING, message, throwable );
       }
   
  +    /**
  +     * Determine if messages of priority "warn" will be logged.
  +     *
  +     * @return true if "warn" messages will be logged
  +     */
       public final boolean isWarnEnabled()
       {
           return m_logger.isLoggable( Level.WARNING );
       }
   
  +    /**
  +     * Log a error message.
  +     *
  +     * @param message the message
  +     */
       public final void error( final String message )
       {
           m_logger.log( Level.SEVERE, message );
       }
   
  +    /**
  +     * Log a error message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       public final void error( final String message, final Throwable throwable )
       {
           m_logger.log( Level.SEVERE, message, throwable );
       }
   
  +    /**
  +     * Determine if messages of priority "error" will be logged.
  +     *
  +     * @return true if "error" messages will be logged
  +     */
       public final boolean isErrorEnabled()
       {
           return m_logger.isLoggable( Level.SEVERE );
       }
   
  +    /**
  +     * Log a fatalError message.
  +     *
  +     * @param message the message
  +     */
       public final void fatalError( final String message )
       {
           m_logger.log( Level.SEVERE, message );
       }
   
  +    /**
  +     * Log a fatalError message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       public final void fatalError( final String message, final Throwable throwable )
       {
           m_logger.log( Level.SEVERE, message, throwable );
       }
   
  +    /**
  +     * Determine if messages of priority "fatalError" will be logged.
  +     *
  +     * @return true if "fatalError" messages will be logged
  +     */
       public final boolean isFatalErrorEnabled()
       {
           return m_logger.isLoggable( Level.SEVERE );
       }
   
  +    /**
  +     * Create a new child logger.
  +     * The name of the child logger is [current-loggers-name].[passed-in-name]
  +     *
  +     * @param name the subname of this logger
  +     * @return the new logger
  +     * @exception IllegalArgumentException if name has an empty element name
  +     */
       public final Logger getChildLogger( final String name )
       {
           return new Jdk14Logger( java.util.logging.Logger
                                   .getLogger( m_logger.getName() + "." + name ) );
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.3       +99 -3     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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Log4JLogger.java	2001/10/31 16:58:32	1.2
  +++ Log4JLogger.java	2001/11/03 04:16:11	1.3
  @@ -14,93 +14,189 @@
    * The default Log4J wrapper class for Logger.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  + * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
    */
  -public final class Log4JLogger implements Logger
  +public final class Log4JLogger
  +    implements Logger
   {
  +    //underlying implementation
       private final Category m_logger;
   
  -    public Log4JLogger( Category logImpl )
  +    /**
  +     * Create a logger that delegates to specified category.
  +     *
  +     * @param logImpl the category to delegate to
  +     */
  +    public Log4JLogger( final Category logImpl )
       {
           m_logger = logImpl;
       }
   
  +    /**
  +     * Log a debug message.
  +     *
  +     * @param message the message
  +     */
       public final void debug( final String message )
       {
           m_logger.debug(message);
       }
   
  +    /**
  +     * Log a debug message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       public final void debug( final String message, final Throwable throwable )
       {
           m_logger.debug( message, throwable );
       }
   
  +    /**
  +     * Determine if messages of priority "debug" will be logged.
  +     *
  +     * @return true if "debug" messages will be logged
  +     */
       public final boolean isDebugEnabled()
       {
           return m_logger.isDebugEnabled();
       }
   
  +    /**
  +     * Log a info message.
  +     *
  +     * @param message the message
  +     */
       public final void info( final String message )
       {
           m_logger.info( message );
       }
   
  +    /**
  +     * Log a info message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       public final void info( final String message, final Throwable throwable )
       {
           m_logger.info( message, throwable );
       }
   
  +    /**
  +     * Determine if messages of priority "info" will be logged.
  +     *
  +     * @return true if "info" messages will be logged
  +     */
       public final boolean isInfoEnabled()
       {
           return m_logger.isInfoEnabled();
       }
   
  +    /**
  +     * Log a warn message.
  +     *
  +     * @param message the message
  +     */
       public final void warn( final String message )
       {
           m_logger.warn( message );
       }
   
  +    /**
  +     * Log a warn message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       public final void warn( final String message, final Throwable throwable )
       {
           m_logger.warn( message, throwable );
       }
   
  +    /**
  +     * Determine if messages of priority "warn" will be logged.
  +     *
  +     * @return true if "warn" messages will be logged
  +     */
       public final boolean isWarnEnabled()
       {
           return m_logger.isEnabledFor( Priority.WARN );
       }
   
  +    /**
  +     * Log a error message.
  +     *
  +     * @param message the message
  +     */
       public final void error( final String message )
       {
           m_logger.error( message );
       }
   
  +    /**
  +     * Log a error message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       public final void error( final String message, final Throwable throwable )
       {
           m_logger.error( message, throwable );
       }
   
  +    /**
  +     * Determine if messages of priority "error" will be logged.
  +     *
  +     * @return true if "error" messages will be logged
  +     */
       public final boolean isErrorEnabled()
       {
           return m_logger.isEnabledFor( Priority.ERROR );
       }
   
  +    /**
  +     * Log a fatalError message.
  +     *
  +     * @param message the message
  +     */
       public final void fatalError( final String message )
       {
           m_logger.fatal( message );
       }
   
  +    /**
  +     * Log a fatalError message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       public final void fatalError( final String message, final Throwable throwable )
       {
           m_logger.fatal( message, throwable );
       }
   
  +    /**
  +     * Determine if messages of priority "fatalError" will be logged.
  +     *
  +     * @return true if "fatalError" messages will be logged
  +     */
       public final boolean isFatalErrorEnabled()
       {
           return m_logger.isEnabledFor( Priority.FATAL );
       }
   
  +    /**
  +     * Create a new child logger.
  +     * The name of the child logger is [current-loggers-name].[passed-in-name]
  +     *
  +     * @param name the subname of this logger
  +     * @return the new logger
  +     * @exception IllegalArgumentException if name has an empty element name
  +     */
       public final Logger getChildLogger( final String name )
       {
           return new Log4JLogger( Category.getInstance( m_logger.getName() + "." + name )
);
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.2       +1 -1      jakarta-avalon/src/java/org/apache/avalon/framework/logger/LogEnabled.java
  
  Index: LogEnabled.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/logger/LogEnabled.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LogEnabled.java	2001/11/01 13:32:46	1.1
  +++ LogEnabled.java	2001/11/03 04:16:11	1.2
  @@ -21,5 +21,5 @@
        *
        * @param logger the logger
        */
  -    void enableLogging ( Logger logger );
  +    void enableLogging( Logger logger );
   }
  
  
  
  1.2       +98 -2     jakarta-avalon/src/java/org/apache/avalon/framework/logger/LogKitLogger.java
  
  Index: LogKitLogger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/logger/LogKitLogger.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LogKitLogger.java	2001/10/31 15:45:50	1.1
  +++ LogKitLogger.java	2001/11/03 04:16:11	1.2
  @@ -11,93 +11,189 @@
    * The default LogKit wrapper class for Logger.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  + * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
    */
  -public final class LogKitLogger implements Logger
  +public final class LogKitLogger 
  +    implements Logger
   {
  +    //underlying implementation to delegate to
       private final org.apache.log.Logger m_logger;
   
  +    /**
  +     * Create a logger that delegates to specified logger.
  +     *
  +     * @param logImpl the LogKit logger to delegate to
  +     */
       public LogKitLogger( org.apache.log.Logger logImpl )
       {
           m_logger = logImpl;
       }
   
  +    /**
  +     * Log a debug message.
  +     *
  +     * @param message the message
  +     */
       public final void debug( final String message )
       {
           m_logger.debug(message);
       }
   
  +    /**
  +     * Log a debug message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       public final void debug( final String message, final Throwable throwable )
       {
           m_logger.debug( message, throwable );
       }
   
  +    /**
  +     * Determine if messages of priority "debug" will be logged.
  +     *
  +     * @return true if "debug" messages will be logged
  +     */
       public final boolean isDebugEnabled()
       {
           return m_logger.isDebugEnabled();
       }
   
  +    /**
  +     * Log a info message.
  +     *
  +     * @param message the message
  +     */
       public final void info( final String message )
       {
           m_logger.info( message );
       }
   
  +    /**
  +     * Log a info message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       public final void info( final String message, final Throwable throwable )
       {
           m_logger.info( message, throwable );
       }
   
  +    /**
  +     * Determine if messages of priority "info" will be logged.
  +     *
  +     * @return true if "info" messages will be logged
  +     */
       public final boolean isInfoEnabled()
       {
           return m_logger.isInfoEnabled();
       }
   
  +    /**
  +     * Log a warn message.
  +     *
  +     * @param message the message
  +     */
       public final void warn( final String message )
       {
           m_logger.warn( message );
       }
   
  +    /**
  +     * Log a warn message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       public final void warn( final String message, final Throwable throwable )
       {
           m_logger.warn( message, throwable );
       }
   
  +    /**
  +     * Determine if messages of priority "warn" will be logged.
  +     *
  +     * @return true if "warn" messages will be logged
  +     */
       public final boolean isWarnEnabled()
       {
           return m_logger.isWarnEnabled();
       }
   
  +    /**
  +     * Log a error message.
  +     *
  +     * @param message the message
  +     */
       public final void error( final String message )
       {
           m_logger.error( message );
       }
   
  +    /**
  +     * Log a error message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       public final void error( final String message, final Throwable throwable )
       {
           m_logger.error( message, throwable );
       }
   
  +    /**
  +     * Determine if messages of priority "error" will be logged.
  +     *
  +     * @return true if "error" messages will be logged
  +     */
       public final boolean isErrorEnabled()
       {
           return m_logger.isErrorEnabled();
       }
   
  +    /**
  +     * Log a fatalError message.
  +     *
  +     * @param message the message
  +     */
       public final void fatalError( final String message )
       {
           m_logger.fatalError( message );
       }
   
  +    /**
  +     * Log a fatalError message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       public final void fatalError( final String message, final Throwable throwable )
       {
           m_logger.fatalError( message, throwable );
       }
   
  +    /**
  +     * Determine if messages of priority "fatalError" will be logged.
  +     *
  +     * @return true if "fatalError" messages will be logged
  +     */
       public final boolean isFatalErrorEnabled()
       {
           return m_logger.isFatalErrorEnabled();
       }
   
  +    /**
  +     * Create a new child logger.
  +     * The name of the child logger is [current-loggers-name].[passed-in-name]
  +     *
  +     * @param name the subname of this logger
  +     * @return the new logger
  +     * @exception IllegalArgumentException if name has an empty element name
  +     */
       public final Logger getChildLogger( final String name )
       {
           return new LogKitLogger( m_logger.getChildLogger( name ) );
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.2       +101 -1    jakarta-avalon/src/java/org/apache/avalon/framework/logger/Logger.java
  
  Index: Logger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/framework/logger/Logger.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Logger.java	2001/10/31 15:45:50	1.1
  +++ Logger.java	2001/11/03 04:16:11	1.2
  @@ -8,31 +8,131 @@
   package org.apache.avalon.framework.logger;
   
   /**
  - * Facade for loggers.
  + * This is a facade for the different logging subsystems.
  + * It offers a simplified interface that follows IOC patterns
  + * and a simplified priority/level/severity abstraction. 
    *
    * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
    */
   public interface Logger
   {
  +    /**
  +     * Log a debug message.
  +     *
  +     * @param message the message
  +     */
       void debug( String message );
  +
  +    /**
  +     * Log a debug message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       void debug( String message, Throwable throwable );
  +
  +    /**
  +     * Determine if messages of priority "debug" will be logged.
  +     *
  +     * @return true if "debug" messages will be logged
  +     */
       boolean isDebugEnabled();
   
  +    /**
  +     * Log a info message.
  +     *
  +     * @param message the message
  +     */
       void info( String message );
  +
  +    /**
  +     * Log a info message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       void info( String message, Throwable throwable );
  +
  +    /**
  +     * Determine if messages of priority "info" will be logged.
  +     *
  +     * @return true if "info" messages will be logged
  +     */
       boolean isInfoEnabled();
   
  +    /**
  +     * Log a warn message.
  +     *
  +     * @param message the message
  +     */
       void warn( String message );
  +
  +    /**
  +     * Log a warn message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       void warn( String message, Throwable throwable );
  +
  +    /**
  +     * Determine if messages of priority "warn" will be logged.
  +     *
  +     * @return true if "warn" messages will be logged
  +     */
       boolean isWarnEnabled();
   
  +    /**
  +     * Log a error message.
  +     *
  +     * @param message the message
  +     */
       void error( String message );
  +
  +    /**
  +     * Log a error message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       void error( String message, Throwable throwable );
  +
  +    /**
  +     * Determine if messages of priority "error" will be logged.
  +     *
  +     * @return true if "error" messages will be logged
  +     */
       boolean isErrorEnabled();
   
  +    /**
  +     * Log a fatalError message.
  +     *
  +     * @param message the message
  +     */
       void fatalError( String message );
  +
  +    /**
  +     * Log a fatalError message.
  +     *
  +     * @param message the message
  +     * @param throwable the throwable
  +     */
       void fatalError( String message, Throwable throwable );
  +
  +    /**
  +     * Determine if messages of priority "fatalError" will be logged.
  +     *
  +     * @return true if "fatalError" messages will be logged
  +     */
       boolean isFatalErrorEnabled();
   
  +    /**
  +     * Create a new child logger.
  +     * The name of the child logger is [current-loggers-name].[passed-in-name]
  +     *
  +     * @param name the subname of this logger
  +     * @return the new logger
  +     * @exception IllegalArgumentException if name has an empty element name
  +     */
       Logger getChildLogger( String 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