You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by rg...@apache.org on 2010/05/30 10:24:40 UTC

svn commit: r949491 - in /logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers: log4j2-api/src/main/java/org/apache/logging/log4j/Level.java log4j2-core/src/main/java/org/apache/logging/log4j/core/Logger.java

Author: rgoers
Date: Sun May 30 08:24:40 2010
New Revision: 949491

URL: http://svn.apache.org/viewvc?rev=949491&view=rev
Log:
Comment on @doubt entries

Modified:
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/Level.java
    logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Logger.java

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/Level.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/Level.java?rev=949491&r1=949490&r2=949491&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/Level.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/Level.java Sun May 30 08:24:40 2010
@@ -29,8 +29,13 @@ package org.apache.logging.log4j;
  * Typically, configuring a level in a filter or on a logger will cause logging events of that level and those
  * that are more specific to pass through the filter.
  * A special level, ALL, is guaranteed to capture all levels when used in logging configurations.
- * @doubt There is not intermediate values available between WARN and INFO for example.  Any reason why the existing log4j values were not retained?
- * @doubt separating the converter from the type would allow alternative converters for different locales or different logging API's (for example, the same level could be FINER with one converter and TRACE with another.
+ * @doubt There is not intermediate values available between WARN and INFO for example.
+ * Any reason why the existing log4j values were not retained? (RG) Yes - It is of type Enum. There is no way
+ * to add a new level without modifying the class.
+ * @doubt separating the converter from the type would allow alternative converters for different locales
+ * or different logging API's (for example, the same level could be FINER with one converter and TRACE
+ * with another. (RG) It's an Enum. All enums must provide the valueOf method. toLevel(String) is carried
+ * over from 1.x.
  */
 public enum Level {
     OFF(0), FATAL(1), ERROR(2), WARN(3), INFO(4), DEBUG(5), TRACE(6), ALL(Integer.MAX_VALUE);

Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Logger.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Logger.java?rev=949491&r1=949490&r2=949491&view=diff
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Logger.java (original)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Logger.java Sun May 30 08:24:40 2010
@@ -28,8 +28,10 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * @doubt All the isEnabled methods could be pushed into a filter interface.  Not sure of the utility of having isEnabled
- *  be able to examine the message pattern and parameters.
+ * @doubt All the isEnabled methods could be pushed into a filter interface.  Not sure of the utility of having
+ * isEnabled be able to examine the message pattern and parameters. (RG) Will look into whether adding an
+ * interface for the isEnabled methods provides any value. The isEnabled methods are required so that Filters
+ * (besides the standard log level check) can participate in the decision.
  */
 public class Logger extends AbstractLogger {
     //private static String FQCN = Logger.class.getName();
@@ -172,8 +174,10 @@ public class Logger extends AbstractLogg
     }
 
     /**
-      * @doubt class is not immutable, so it should not be shared between threads.
-      */
+     * @doubt class is not immutable, so it should not be shared between threads. (RG) The class MUST be
+     * shared between threads. The level could be made final and a new PrivateConfig constructed when
+     * setLevel is called.
+     */
     protected class PrivateConfig {
 	/** @doubt public member variables?  (RG) Should be changed. Did this while making the Log4j 1.2 API **/
         public final LoggerConfig loggerConfig;



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