Author: carnold
Date: Sun May 30 21:53:24 2010
New Revision: 949590
URL: http://svn.apache.org/viewvc?rev=949590&view=rev
Log:
Code review comments
Added:
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/log4j2-core.iml
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/Log4jLogEvent.java
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.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=949590&r1=949589&r2=949590&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 21:53:24 2010
@@ -31,7 +31,11 @@ package org.apache.logging.log4j;
* 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? (RG) Yes - It
is of type Enum. There is no way
- * to add a new level without modifying the class.
+ * to add a new level without modifying the class. (CA) log4j 1.2 allows the
introduction of arbitrary
+ * user--defined levels and questions about how to do it come up from time to
time on the mailing list.
+ * Generally it results from trying to overload level to indicate something
about the intended audience
+ * which would be better served by appropriate design of the logger hierarchy.
However, it is asked
+ * frequently enough that somebody is using it appropriately.
* @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
Added:
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/log4j2-core.iml
URL:
http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/log4j2-core.iml?rev=949590&view=auto
==============================================================================
---
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/log4j2-core.iml
(added)
+++
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/log4j2-core.iml
Sun May 30 21:53:24 2010
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true"
type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
+ <output url="file://$MODULE_DIR$/target/classes" />
+ <output-test url="file://$MODULE_DIR$/target/test-classes" />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/main/resources"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/java"
isTestSource="true" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test/resources"
isTestSource="true" />
+ <excludeFolder url="file://$MODULE_DIR$/target" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.3.1"
level="project" />
+ <orderEntry type="library" exported="" name="Maven:
org.apache.logging:log4j2-api:1.99.0-SNAPSHOT" level="project" />
+ <orderEntry type="library" scope="TEST" name="Maven: oro:oro:2.0.8"
level="project" />
+ </component>
+</module>
+
Modified:
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Log4jLogEvent.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/Log4jLogEvent.java?rev=949590&r1=949589&r2=949590&view=diff
==============================================================================
---
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Log4jLogEvent.java
(original)
+++
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Log4jLogEvent.java
Sun May 30 21:53:24 2010
@@ -123,6 +123,18 @@ public class Log4jLogEvent implements Lo
* (RG) The loop finds the FQCN and on the next iteration returns the
StackTraceElement of
* the caller of FQCN. Don't know what you mean by "not all of them" as it
only returns
* a single element.
+ *
+ * Say that FQCN is "MySpecializedLogger" and the stack trace returned
from getStackTrace is:
+ *
+ * Log4jLogEvent.getSource
+ * MySpecializedLogger.log
+ * MySpecializedLogger.info
+ * ClientClass.doSomething
+ * ClientClass.main
+ *
+ * When walking the stack, next will be set to true at
MySpecializedLogger.log
+ * and MySpecializerLogger.info will be returned (at least from code
inspection).
+ *
*/
public StackTraceElement getSource() {
if (fqcnOfLogger == null) {
Modified:
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.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/LoggerContext.java?rev=949590&r1=949589&r2=949590&view=diff
==============================================================================
---
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
(original)
+++
logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
Sun May 30 21:53:24 2010
@@ -76,7 +76,9 @@ public class LoggerContext implements or
/**
* @doubt no check for null, could cause NPE if reconfigure is called.
(RG) I started to fix
* this and realized the proper fix was to check for null and if null
throw a LoggingException. Is
- * that really better than an NPE?
+ * that really better than an NPE? (CA) Throwing an NPE on the attempt to
setConfiguration(null)
+ * is much better than allowing the set to succeed and then throwing an
NPE on a later call
+ * to addFilter or removeFilter (would not happen on reconfigure, misread
it originally)
*/
public synchronized Configuration setConfiguration(Configuration config) {
Configuration prev = this.config;
@@ -84,6 +86,7 @@ public class LoggerContext implements or
return prev;
}
+ /** @doubt method scoped config member hides LoggerContext.config. */
public synchronized void reconfigure() {
logger.debug("Reconfiguration started");
Configuration config =
ConfigurationFactory.getInstance().getConfiguration();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]