commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject cvs commit: jakarta-commons/logging/src/java/org/apache/commons/logging/impl AvalonLogger.java Jdk14Logger.java Log4JCategoryLog.java Log4JLogger.java Log4jFactory.java LogFactoryImpl.java SimpleLog.java
Date Sat, 28 Feb 2004 17:54:14 GMT
rdonkin     2004/02/28 09:54:14

  Modified:    logging/src/java/org/apache/commons/logging Log.java
                        LogFactory.java LogSource.java package.html
               logging/src/java/org/apache/commons/logging/impl
                        AvalonLogger.java Jdk14Logger.java
                        Log4JCategoryLog.java Log4JLogger.java
                        Log4jFactory.java LogFactoryImpl.java
                        SimpleLog.java
  Log:
  Fixes for typos and speiling mistakes in the javadocs Contributed by Dennis Lundberg.
  
  Revision  Changes    Path
  1.17      +11 -11    jakarta-commons/logging/src/java/org/apache/commons/logging/Log.java
  
  Index: Log.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/Log.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Log.java	9 Oct 2003 21:37:47 -0000	1.16
  +++ Log.java	28 Feb 2004 17:54:14 -0000	1.17
  @@ -114,7 +114,7 @@
        * <p> Is debug logging currently enabled? </p>
        *
        * <p> Call this method to prevent having to perform expensive operations
  -     * (for example, <code>String</code> concatination)
  +     * (for example, <code>String</code> concatenation)
        * when the log level is more than debug. </p>
        */
       public boolean isDebugEnabled();
  @@ -124,7 +124,7 @@
        * <p> Is error logging currently enabled? </p>
        *
        * <p> Call this method to prevent having to perform expensive operations
  -     * (for example, <code>String</code> concatination)
  +     * (for example, <code>String</code> concatenation)
        * when the log level is more than error. </p>
        */
       public boolean isErrorEnabled();
  @@ -134,7 +134,7 @@
        * <p> Is fatal logging currently enabled? </p>
        *
        * <p> Call this method to prevent having to perform expensive operations
  -     * (for example, <code>String</code> concatination)
  +     * (for example, <code>String</code> concatenation)
        * when the log level is more than fatal. </p>
        */
       public boolean isFatalEnabled();
  @@ -144,7 +144,7 @@
        * <p> Is info logging currently enabled? </p>
        *
        * <p> Call this method to prevent having to perform expensive operations
  -     * (for example, <code>String</code> concatination)
  +     * (for example, <code>String</code> concatenation)
        * when the log level is more than info. </p>
        */
       public boolean isInfoEnabled();
  @@ -154,7 +154,7 @@
        * <p> Is trace logging currently enabled? </p>
        *
        * <p> Call this method to prevent having to perform expensive operations
  -     * (for example, <code>String</code> concatination)
  +     * (for example, <code>String</code> concatenation)
        * when the log level is more than trace. </p>
        */
       public boolean isTraceEnabled();
  @@ -164,8 +164,8 @@
        * <p> Is warning logging currently enabled? </p>
        *
        * <p> Call this method to prevent having to perform expensive operations
  -     * (for example, <code>String</code> concatination)
  -     * when the log level is more than warning. </p>
  +     * (for example, <code>String</code> concatenation)
  +     * when the log level is more than warn. </p>
        */
       public boolean isWarnEnabled();
   
  
  
  
  1.25      +47 -47    jakarta-commons/logging/src/java/org/apache/commons/logging/LogFactory.java
  
  Index: LogFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/LogFactory.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- LogFactory.java	9 Oct 2003 21:37:47 -0000	1.24
  +++ LogFactory.java	28 Feb 2004 17:54:14 -0000	1.25
  @@ -79,7 +79,7 @@
    * <p>Factory for creating {@link Log} instances, with discovery and
    * configuration features similar to that employed by standard Java APIs
    * such as JAXP.</p>
  - * 
  + *
    * <p><strong>IMPLEMENTATION NOTE</strong> - This implementation is heavily
    * based on the SAXParserFactory and DocumentBuilderFactory implementations
    * (corresponding to the JAXP pluggability APIs) found in Apache Xerces.</p>
  @@ -117,7 +117,7 @@
           "commons-logging.properties";
   
       /**
  -     * JDK1.3+ 'Service Provider' specification 
  +     * JDK1.3+ 'Service Provider' specification
        * ( http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html )
        */
       protected static final String SERVICE_ID =
  @@ -189,7 +189,7 @@
   
       /**
        * Release any internal references to previously created {@link Log}
  -     * instances returned by this factory.  This is useful environments
  +     * instances returned by this factory.  This is useful in environments
        * like servlet containers, which implement application reloading by
        * throwing away a ClassLoader.  Dangling references to objects in that
        * class loader would prevent garbage collection.
  @@ -273,8 +273,8 @@
               return factory;
   
   
  -        // Load properties file..
  -        // will be used one way or another in the end.
  +        // Load properties file.
  +        // Will be used one way or another in the end.
   
           Properties props=null;
           try {
  @@ -290,7 +290,7 @@
           } catch (SecurityException e) {
           }
   
  -        
  +
           // First, try the system property
           try {
               String factoryClass = System.getProperty(FACTORY_PROPERTY);
  @@ -305,7 +305,7 @@
           // Second, try to find a service by using the JDK1.3 jar
           // discovery mechanism. This will allow users to plug a logger
           // by just placing it in the lib/ directory of the webapp ( or in
  -        // CLASSPATH or equivalent ). This is similar with the second
  +        // CLASSPATH or equivalent ). This is similar to the second
           // step, except that it uses the (standard?) jdk1.3 location in the jar.
   
           if (factory == null) {
  @@ -322,13 +322,13 @@
                       } catch (java.io.UnsupportedEncodingException e) {
                           rd = new BufferedReader(new InputStreamReader(is));
                       }
  -                    
  +
                       String factoryClassName = rd.readLine();
                       rd.close();
  -                    
  +
                       if (factoryClassName != null &&
                           ! "".equals(factoryClassName)) {
  -                        
  +
                           factory= newFactory( factoryClassName, contextClassLoader );
                       }
                   }
  @@ -338,7 +338,7 @@
           }
   
   
  -        // Third try a properties file. 
  +        // Third try a properties file.
           // If the properties file exists, it'll be read and the properties
           // used. IMHO ( costin ) System property and JDK1.3 jar service
           // should be enough for detecting the class name. The properties
  @@ -359,10 +359,10 @@
           if (factory == null) {
               factory = newFactory(FACTORY_DEFAULT, LogFactory.class.getClassLoader());
           }
  -        
  +
           if (factory != null) {
               /**
  -             * Always cache using context class loader..
  +             * Always cache using context class loader.
                */
               cacheFactory(contextClassLoader, factory);
   
  @@ -375,7 +375,7 @@
                   }
               }
           }
  -        
  +
           return factory;
       }
   
  @@ -384,7 +384,7 @@
        * Convenience method to return a named logger, without the application
        * having to care about factories.
        *
  -     * @param clazz Class for which a log name will be derived
  +     * @param clazz Class from which a log name will be derived
        *
        * @exception LogConfigurationException if a suitable <code>Log</code>
        *  instance cannot be returned
  @@ -440,7 +440,7 @@
       /**
        * Release any internal references to previously created {@link LogFactory}
        * instances, after calling the instance method <code>release()</code>
on
  -     * each of them.  This is useful environments like servlet containers,
  +     * each of them.  This is useful in environments like servlet containers,
        * which implement application reloading by throwing away a ClassLoader.
        * Dangling references to objects in that class loader would prevent
        * garbage collection.
  @@ -465,7 +465,7 @@
       /**
        * Return the thread context class loader if available.
        * Otherwise return null.
  -     * 
  +     *
        * The thread context class loader is available for JDK 1.2
        * or later, if certain security conditions are met.
        *
  @@ -492,12 +492,12 @@
                    * InvocationTargetException is thrown by 'invoke' when
                    * the method being invoked (getContextClassLoader) throws
                    * an exception.
  -                 * 
  +                 *
                    * getContextClassLoader() throws SecurityException when
                    * the context class loader isn't an ancestor of the
                    * calling class's class loader, or if security
                    * permissions are restricted.
  -                 * 
  +                 *
                    * In the first case (not related), we want to ignore and
                    * keep going.  We cannot help but also ignore the second
                    * with the logic below, but other calls elsewhere (to
  @@ -523,18 +523,18 @@
       }
   
       /**
  -     * Check cached factories (keyed by classLoader)
  +     * Check cached factories (keyed by contextClassLoader)
        */
       private static LogFactory getCachedFactory(ClassLoader contextClassLoader)
       {
           LogFactory factory = null;
  -        
  +
           if (contextClassLoader != null)
               factory = (LogFactory) factories.get(contextClassLoader);
  -        
  +
           return factory;
       }
  -    
  +
       private static void cacheFactory(ClassLoader classLoader, LogFactory factory)
       {
           if (classLoader != null && factory != null)
  @@ -562,18 +562,18 @@
               new PrivilegedAction() {
                   public Object run() {
                       // This will be used to diagnose bad configurations
  -                    // and allow a useful message to be sent to the user 
  +                    // and allow a useful message to be sent to the user
                       Class logFactoryClass = null;
                       try {
                           if (classLoader != null) {
                               try {
  -                                // first the given class loader param (thread class loader)
  -                                
  -                                // warning: must typecast here & allow exception
  -                                // to be generated/caught & recast propertly.
  +                                // First the given class loader param (thread class loader)
  +
  +                                // Warning: must typecast here & allow exception
  +                                // to be generated/caught & recast properly.
                                   logFactoryClass = classLoader.loadClass(factoryClass);
                                   return (LogFactory) logFactoryClass.newInstance();
  -                                
  +
                               } catch (ClassNotFoundException ex) {
                                   if (classLoader == LogFactory.class.getClassLoader()) {
                                       // Nothing more to try, onwards.
  @@ -585,39 +585,39 @@
                                       // Nothing more to try, onwards.
                                       throw e;
                                   }
  -                              
  +
                               } catch(ClassCastException e){
  -                                
  +
                                 if (classLoader == LogFactory.class.getClassLoader()) {
                                       // Nothing more to try, onwards (bug in loader implementation).
                                       throw e;
                                  }
                               }
  -                            // ignore exception, continue  
  +                            // Ignore exception, continue
                           }
  -            
  +
                           /* At this point, either classLoader == null, OR
  -                         * classLoader was unable to load factoryClass..
  -                         * try the class loader that loaded this class:
  +                         * classLoader was unable to load factoryClass.
  +                         * Try the class loader that loaded this class:
                            * LogFactory.getClassLoader().
  -                         * 
  +                         *
                            * Notes:
                            * a) LogFactory.class.getClassLoader() may return 'null'
                            *    if LogFactory is loaded by the bootstrap classloader.
                            * b) The Java endorsed library mechanism is instead
                            *    Class.forName(factoryClass);
                            */
  -                        // warning: must typecast here & allow exception
  -                        // to be generated/caught & recast propertly.
  +                        // Warning: must typecast here & allow exception
  +                        // to be generated/caught & recast properly.
                           logFactoryClass = Class.forName(factoryClass);
                           return (LogFactory) logFactoryClass.newInstance();
                       } catch (Exception e) {
  -                        // check to see if we've got a bad configuration
  -                        if (logFactoryClass != null 
  +                        // Check to see if we've got a bad configuration
  +                        if (logFactoryClass != null
                               && !LogFactory.class.isAssignableFrom(logFactoryClass))
{
                               return new LogConfigurationException(
                                   "The chosen LogFactory implementation does not extend LogFactory."
  -                                + " Please check your configuration.", 
  +                                + " Please check your configuration.",
                                   e);
                           }
                           return new LogConfigurationException(e);
  @@ -627,10 +627,10 @@
   
           if (result instanceof LogConfigurationException)
               throw (LogConfigurationException)result;
  -            
  +
           return (LogFactory)result;
       }
  -    
  +
       private static InputStream getResourceAsStream(final ClassLoader loader,
                                                      final String name)
       {
  
  
  
  1.20      +5 -5      jakarta-commons/logging/src/java/org/apache/commons/logging/LogSource.java
  
  Index: LogSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/LogSource.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- LogSource.java	9 Oct 2003 21:37:47 -0000	1.19
  +++ LogSource.java	28 Feb 2004 17:54:14 -0000	1.20
  @@ -108,7 +108,7 @@
       /** Is log4j available (in the current classpath) */
       static protected boolean log4jIsAvailable = false;
   
  -    /** Is JD 1.4 logging available */
  +    /** Is JDK 1.4 logging available */
       static protected boolean jdk14IsAvailable = false;
   
       /** Constructor for current log class */
  
  
  
  1.12      +8 -8      jakarta-commons/logging/src/java/org/apache/commons/logging/package.html
  
  Index: package.html
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/package.html,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- package.html	16 Aug 2003 23:46:31 -0000	1.11
  +++ package.html	28 Feb 2004 17:54:14 -0000	1.12
  @@ -19,7 +19,7 @@
       Avalon project.  Each named <a href="Log.html">Log</a> instance is
       connected to a corresponding LogKit <code>Logger</code>.</li>
   <li><a href="impl/NoOpLog.html">NoOpLog</a> implementation that simply
swallows
  -    all log output, for all named <a href="Log.html">Log</a> isntances.</li>
  +    all log output, for all named <a href="Log.html">Log</a> instances.</li>
   <li><a href="impl/SimpleLog.html">SimpleLog</a> implementation that writes
all
       log output, for all named <a href="Log.html">Log</a> instances, to
       System.err.</li>
  @@ -63,7 +63,7 @@
   <h3>Configuring the Commons Logging Package</h3>
   
   
  -<h4>Choosing A <code>LogFactory</code> Implementation</h4>
  +<h4>Choosing a <code>LogFactory</code> Implementation</h4>
   
   <p>From an application perspective, the first requirement is to retrieve an
   object reference to the <code>LogFactory</code> instance that will be used
  @@ -135,7 +135,7 @@
       <li>If the application is executing on a JDK 1.4 system, use
           the corresponding wrapper class
           (<a href="impl/Jdk14Logger.html">Jdk14Logger</a>).</li>
  -    <li>Fall back to the default simple logging wrapper
  +    <li>Fall back to the default simple logging implementation
           (<a href="impl/SimpleLog.html">SimpleLog</a>).</li>
       </ul></li>
   <li>Load the class of the specified name from the thread context class
  @@ -152,8 +152,8 @@
   
   <h4>Configuring the Underlying Logging System</h4>
   
  -<p>The basic principle is that the user is totally responsible for the 
  -configuration of the underlying logging system. 
  +<p>The basic principle is that the user is totally responsible for the
  +configuration of the underlying logging system.
   Commons-logging should not change the existing configuration.</p>
   
   <p>Each individual <a href="Log.html">Log</a> implementation may
  @@ -187,11 +187,11 @@
   <p>For convenience, <code>LogFactory</code> also offers a static method
   <code>getLog()</code> that combines the typical two-step pattern:</p>
   <pre>
  -  Log log = LogFactory.getFactory().getInstance("Foo");
  +  Log log = LogFactory.getFactory().getInstance(Foo.class);
   </pre>
   <p>into a single method call:</p>
   <pre>
  -  Log log = LogFactory.getLog("Foo");
  +  Log log = LogFactory.getLog(Foo.class);
   </pre>
   
   <p>For example, you might use the following technique to initialize and
  @@ -203,7 +203,7 @@
   public class MyComponent {
   
     protected static Log log =
  -    LogFactory.getLog("my.component");
  +    LogFactory.getLog(MyComponent.class);
   
     // Called once at startup time
     public void start() {
  
  
  
  1.7       +10 -10    jakarta-commons/logging/src/java/org/apache/commons/logging/impl/AvalonLogger.java
  
  Index: AvalonLogger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/impl/AvalonLogger.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AvalonLogger.java	9 Oct 2003 21:37:47 -0000	1.6
  +++ AvalonLogger.java	28 Feb 2004 17:54:14 -0000	1.7
  @@ -66,9 +66,9 @@
   import org.apache.commons.logging.Log;
   
   /**
  - * Implementation of commons-logging Log interface that delegates all 
  - * logging calls to Avalon logging abstraction: the Logger interface.
  - * 
  + * Implementation of commons-logging Log interface that delegates all
  + * logging calls to the Avalon logging abstraction: the Logger interface.
  + *
    * @author <a href="mailto:neeme@apache.org">Neeme Praks</a>
    * @version $Revision$ $Date$
    */
  @@ -79,7 +79,7 @@
       private String name = null;
   
       /**
  -     * @param logger the avalon logger implementation to delegate to 
  +     * @param logger the avalon logger implementation to delegate to
        */
       public AvalonLogger(Logger logger) {
           this.name = name;
  @@ -87,10 +87,10 @@
       }
   
       /**
  -     * @param name the name of the avalon logger implementation to delegate to 
  +     * @param name the name of the avalon logger implementation to delegate to
        */
       public AvalonLogger(String name) {
  -        if (defaultLogger == null) 
  +        if (defaultLogger == null)
               throw new NullPointerException("default logger has to be specified if this
constructor is used!");
           this.logger = getLogger();
       }
  
  
  
  1.11      +6 -6      jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Jdk14Logger.java
  
  Index: Jdk14Logger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Jdk14Logger.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Jdk14Logger.java	9 Oct 2003 21:37:47 -0000	1.10
  +++ Jdk14Logger.java	28 Feb 2004 17:54:14 -0000	1.11
  @@ -249,7 +249,7 @@
   
   
       /**
  -     * Is tace logging currently enabled?
  +     * Is trace logging currently enabled?
        */
       public boolean isTraceEnabled() {
           return (getLogger().isLoggable(Level.FINEST));
  @@ -257,7 +257,7 @@
   
   
       /**
  -     * Is warning logging currently enabled?
  +     * Is warn logging currently enabled?
        */
       public boolean isWarnEnabled() {
           return (getLogger().isLoggable(Level.WARNING));
  
  
  
  1.14      +7 -7      jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Log4JCategoryLog.java
  
  Index: Log4JCategoryLog.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Log4JCategoryLog.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Log4JCategoryLog.java	9 Oct 2003 21:37:47 -0000	1.13
  +++ Log4JCategoryLog.java	28 Feb 2004 17:54:14 -0000	1.14
  @@ -86,7 +86,7 @@
   
       /** The fully qualified name of the Log4JCategoryLog class. */
       private static final String FQCN = Log4JCategoryLog.class.getName();
  -    
  +
       /** Log to this category */
       private Category category = null;
   
  @@ -98,13 +98,13 @@
   
   
       /**
  -     * Base constructor
  +     * Base constructor.
        */
       public Log4JCategoryLog(String name) {
           this.category=Category.getInstance(name);
       }
   
  -    /** For use with a log4j factory
  +    /** For use with a log4j factory.
        */
       public Log4JCategoryLog(Category category ) {
           this.category=category;
  
  
  
  1.9       +7 -7      jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Log4JLogger.java
  
  Index: Log4JLogger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Log4JLogger.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Log4JLogger.java	9 Oct 2003 21:37:47 -0000	1.8
  +++ Log4JLogger.java	28 Feb 2004 17:54:14 -0000	1.9
  @@ -85,7 +85,7 @@
   
       /** The fully qualified name of the Log4JLogger class. */
       private static final String FQCN = Log4JLogger.class.getName();
  -    
  +
       /** Log to this logger */
       private transient Logger logger = null;
   
  @@ -100,14 +100,14 @@
   
   
       /**
  -     * Base constructor
  +     * Base constructor.
        */
       public Log4JLogger(String name) {
           this.name = name;
           this.logger = getLogger();
       }
   
  -    /** For use with a log4j factory
  +    /** For use with a log4j factory.
        */
       public Log4JLogger(Logger logger ) {
           this.name = logger.getName();
  
  
  
  1.8       +6 -6      jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Log4jFactory.java
  
  Index: Log4jFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/impl/Log4jFactory.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Log4jFactory.java	9 Oct 2003 21:37:47 -0000	1.7
  +++ Log4jFactory.java	28 Feb 2004 17:54:14 -0000	1.8
  @@ -92,7 +92,7 @@
        */
       private Hashtable attributes = new Hashtable();
   
  -    // previously returned instances, to avoid creation of proxies
  +    // Previously returned instances, to avoid creation of proxies
       private Hashtable instances = new Hashtable();
   
       // --------------------------------------------------------- Public Methods
  @@ -164,7 +164,7 @@
   
       /**
        * Release any internal references to previously created {@link Log}
  -     * instances returned by this factory.  This is useful environments
  +     * instances returned by this factory.  This is useful in environments
        * like servlet containers, which implement application reloading by
        * throwing away a ClassLoader.  Dangling references to objects in that
        * class loader would prevent garbage collection.
  @@ -173,7 +173,7 @@
   
           instances.clear();
   
  -        // what's the log4j mechanism to cleanup ??? 
  +        // what's the log4j mechanism to cleanup ???
       }
   
   
  
  
  
  1.29      +6 -6      jakarta-commons/logging/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java
  
  Index: LogFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- LogFactoryImpl.java	9 Oct 2003 21:37:47 -0000	1.28
  +++ LogFactoryImpl.java	28 Feb 2004 17:54:14 -0000	1.29
  @@ -146,7 +146,7 @@
   
   
       /**
  -     * Configuration attributes
  +     * Configuration attributes.
        */
       protected Hashtable attributes = new Hashtable();
   
  @@ -280,7 +280,7 @@
       /**
        * Release any internal references to previously created
        * {@link org.apache.commons.logging.Log}
  -     * instances returned by this factory.  This is useful environments
  +     * instances returned by this factory.  This is useful in environments
        * like servlet containers, which implement application reloading by
        * throwing away a ClassLoader.  Dangling references to objects in that
        * class loader would prevent garbage collection.
  
  
  
  1.15      +29 -29    jakarta-commons/logging/src/java/org/apache/commons/logging/impl/SimpleLog.java
  
  Index: SimpleLog.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/logging/src/java/org/apache/commons/logging/impl/SimpleLog.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- SimpleLog.java	9 Oct 2003 21:37:47 -0000	1.14
  +++ SimpleLog.java	28 Feb 2004 17:54:14 -0000	1.15
  @@ -93,7 +93,7 @@
    *     Set to <code>true</code> if you want the Log instance name to be
    *     included in output messages. Defaults to <code>false</code>.</li>
    * <li><code>org.apache.commons.logging.simplelog.showShortLogname</code>
-
  - *     Set to <code>true</code> if you want the last componet of the name to
be
  + *     Set to <code>true</code> if you want the last component of the name
to be
    *     included in output messages. Defaults to <code>true</code>.</li>
    * <li><code>org.apache.commons.logging.simplelog.showdatetime</code>
-
    *     Set to <code>true</code> if you want the current date and time
  @@ -158,7 +158,7 @@
       public static final int LOG_LEVEL_OFF    = (LOG_LEVEL_FATAL + 1);
   
       // ------------------------------------------------------------ Initializer
  -    
  +
       private static String getStringProperty(String name) {
           String prop = null;
   	try {
  @@ -179,11 +179,11 @@
           return (prop == null) ? dephault : "true".equalsIgnoreCase(prop);
       }
   
  -    // initialize class attributes
  -    // load properties file, if found.
  -    // override with system properties.
  +    // Initialize class attributes.
  +    // Load properties file, if found.
  +    // Override with system properties.
       static {
  -        // add props from the resource simplelog.properties
  +        // Add props from the resource simplelog.properties
           InputStream in = getResourceAsStream("simplelog.properties");
           if(null != in) {
               try {
  @@ -228,12 +228,12 @@
   
           logName = name;
   
  -        // set initial log level
  +        // Set initial log level
           // Used to be: set default log level to ERROR
           // IMHO it should be lower, but at least info ( costin ).
           setLevel(SimpleLog.LOG_LEVEL_INFO);
   
  -        // set log level from properties
  +        // Set log level from properties
           String lvl = getStringProperty(systemPrefix + "log." + logName);
           int i = String.valueOf(name).lastIndexOf(".");
           while(null == lvl && i > -1) {
  @@ -299,16 +299,16 @@
        * and then prints to <code>System.err</code>.</p>
        */
       protected void log(int type, Object message, Throwable t) {
  -        // use a string buffer for better performance
  +        // Use a string buffer for better performance
           StringBuffer buf = new StringBuffer();
   
  -        // append date-time if so configured
  +        // Append date-time if so configured
           if(showDateTime) {
               buf.append(dateFormatter.format(new Date()));
               buf.append(" ");
           }
   
  -        // append a readable representation of the log leve
  +        // Append a readable representation of the log level
           switch(type) {
               case SimpleLog.LOG_LEVEL_TRACE: buf.append("[TRACE] "); break;
               case SimpleLog.LOG_LEVEL_DEBUG: buf.append("[DEBUG] "); break;
  @@ -318,7 +318,7 @@
               case SimpleLog.LOG_LEVEL_FATAL: buf.append("[FATAL] "); break;
           }
   
  -        // append the name of the log instance if so configured
  +        // Append the name of the log instance if so configured
    	if( showShortName) {
               if( prefix==null ) {
                   // cut all but the last component of the name for both styles
  @@ -330,23 +330,23 @@
               buf.append(String.valueOf(logName)).append(" - ");
           }
   
  -        // append the message
  +        // Append the message
           buf.append(String.valueOf(message));
   
  -        // append stack trace if not null
  +        // Append stack trace if not null
           if(t != null) {
               buf.append(" <");
               buf.append(t.toString());
               buf.append(">");
   
  -            java.io.StringWriter sw= new java.io.StringWriter(1024); 
  -            java.io.PrintWriter pw= new java.io.PrintWriter(sw); 
  +            java.io.StringWriter sw= new java.io.StringWriter(1024);
  +            java.io.PrintWriter pw= new java.io.PrintWriter(sw);
               t.printStackTrace(pw);
               pw.close();
               buf.append(sw.toString());
           }
   
  -        // print to System.err
  +        // Print to System.err
           System.err.println(buf.toString());
       }
   
  @@ -389,7 +389,7 @@
   
   
       /**
  -     * <p> Log a message with debug log level.</p>
  +     * <p> Log a message with trace log level.</p>
        */
       public final void trace(Object message) {
   
  @@ -400,7 +400,7 @@
   
   
       /**
  -     * <p> Log an error with debug log level.</p>
  +     * <p> Log an error with trace log level.</p>
        */
       public final void trace(Object message, Throwable t) {
   
  @@ -579,7 +579,7 @@
       /**
        * Return the thread context class loader if available.
        * Otherwise return null.
  -     * 
  +     *
        * The thread context class loader is available for JDK 1.2
        * or later, if certain security conditions are met.
        *
  @@ -594,7 +594,7 @@
               try {
                   // Are we running on a JDK 1.2 or later system?
                   Method method = Thread.class.getMethod("getContextClassLoader", null);
  -    
  +
                   // Get the thread context class loader (if there is one)
                   try {
                       classLoader = (ClassLoader)method.invoke(Thread.currentThread(), null);
  @@ -605,12 +605,12 @@
                        * InvocationTargetException is thrown by 'invoke' when
                        * the method being invoked (getContextClassLoader) throws
                        * an exception.
  -                     * 
  +                     *
                        * getContextClassLoader() throws SecurityException when
                        * the context class loader isn't an ancestor of the
                        * calling class's class loader, or if security
                        * permissions are restricted.
  -                     * 
  +                     *
                        * In the first case (not related), we want to ignore and
                        * keep going.  We cannot help but also ignore the second
                        * with the logic below, but other calls elsewhere (to
  @@ -631,7 +631,7 @@
                   ;  // ignore
               }
           }
  -    
  +
           if (classLoader == null) {
               classLoader = SimpleLog.class.getClassLoader();
           }
  @@ -639,7 +639,7 @@
           // Return the selected class loader
           return classLoader;
       }
  -    
  +
       private static InputStream getResourceAsStream(final String name)
       {
           return (InputStream)AccessController.doPrivileged(
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message