logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1414958 - in /logging/log4j/log4j2/trunk/api/src: main/java/org/apache/logging/log4j/spi/AbstractLogger.java test/java/org/apache/logging/log4j/AbstractLoggerTest.java
Date Wed, 28 Nov 2012 22:07:20 GMT
Author: ggregory
Date: Wed Nov 28 22:07:19 2012
New Revision: 1414958

URL: http://svn.apache.org/viewvc?rev=1414958&view=rev
Log:
<action issue="LOG4J2-127" dev="rgoers" type="fix">AbstractLogger methods were not passing
Markers to the isEnabled methods.</action>
Fixed error(Marker, Message) and fatal(Marker, Message). 

Modified:
    logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
    logging/log4j/log4j2/trunk/api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java

Modified: logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java?rev=1414958&r1=1414957&r2=1414958&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
(original)
+++ logging/log4j/log4j2/trunk/api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
Wed Nov 28 22:07:19 2012
@@ -1157,7 +1157,7 @@ public abstract class AbstractLogger imp
      */
     public void error(Marker marker, Message msg) {
         if (isEnabled(Level.ERROR, marker, msg, null)) {
-            log(null, FQCN, Level.ERROR, msg, null);
+            log(marker, FQCN, Level.ERROR, msg, null);
         }
     }
 
@@ -1354,7 +1354,7 @@ public abstract class AbstractLogger imp
      */
     public void fatal(Marker marker, Message msg) {
         if (isEnabled(Level.FATAL, marker, msg, null)) {
-            log(null, FQCN, Level.FATAL, msg, null);
+            log(marker, FQCN, Level.FATAL, msg, null);
         }
     }
 

Modified: logging/log4j/log4j2/trunk/api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java?rev=1414958&r1=1414957&r2=1414958&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java
(original)
+++ logging/log4j/log4j2/trunk/api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java
Wed Nov 28 22:07:19 2012
@@ -66,6 +66,7 @@ public class AbstractLoggerTest extends 
         new LogEvent(null, simple, t),
         new LogEvent(marker, simple, null),
         new LogEvent(marker, simple, t),
+        new LogEvent(marker, simple, null),
 
     };
 
@@ -107,6 +108,8 @@ public class AbstractLoggerTest extends 
         trace(MarkerManager.getMarker("TEST"), simple, null);
         currentEvent = events[13];
         trace(MarkerManager.getMarker("TEST"), simple, t);
+        currentEvent = events[14];
+        trace(MarkerManager.getMarker("TEST"), simple);
     }
 
     @Test
@@ -147,6 +150,8 @@ public class AbstractLoggerTest extends 
         debug(MarkerManager.getMarker("TEST"), simple, null);
         currentEvent = events[13];
         debug(MarkerManager.getMarker("TEST"), simple, t);
+        currentEvent = events[14];
+        debug(MarkerManager.getMarker("TEST"), simple);
     }
 
     @Test
@@ -187,6 +192,8 @@ public class AbstractLoggerTest extends 
         info(MarkerManager.getMarker("TEST"), simple, null);
         currentEvent = events[13];
         info(MarkerManager.getMarker("TEST"), simple, t);
+        currentEvent = events[14];
+        info(MarkerManager.getMarker("TEST"), simple);
     }
 
     @Test
@@ -227,6 +234,8 @@ public class AbstractLoggerTest extends 
         warn(MarkerManager.getMarker("TEST"), simple, null);
         currentEvent = events[13];
         warn(MarkerManager.getMarker("TEST"), simple, t);
+        currentEvent = events[14];
+        warn(MarkerManager.getMarker("TEST"), simple);
     }
 
     @Test
@@ -267,6 +276,8 @@ public class AbstractLoggerTest extends 
         error(MarkerManager.getMarker("TEST"), simple, null);
         currentEvent = events[13];
         error(MarkerManager.getMarker("TEST"), simple, t);
+        currentEvent = events[14];
+        error(MarkerManager.getMarker("TEST"), simple);
     }
 
     @Test
@@ -307,6 +318,8 @@ public class AbstractLoggerTest extends 
         fatal(MarkerManager.getMarker("TEST"), simple, null);
         currentEvent = events[13];
         fatal(MarkerManager.getMarker("TEST"), simple, t);
+        currentEvent = events[14];
+        fatal(MarkerManager.getMarker("TEST"), simple);
     }
 
     @Override



Mime
View raw message