logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1581374 - in /logging/log4j/log4j2/trunk: log4j-api/src/main/java/org/apache/logging/log4j/ log4j-api/src/main/java/org/apache/logging/log4j/status/ log4j-api/src/test/java/org/apache/logging/log4j/ log4j-core/src/main/java/org/apache/logg...
Date Tue, 25 Mar 2014 15:31:13 GMT
Author: ggregory
Date: Tue Mar 25 15:31:13 2014
New Revision: 1581374

URL: http://svn.apache.org/r1581374
Log:
<action issue="LOG4J2-579" dev="ggregory" type="fix">
  Rework Level comparison APIs.
</action>

Modified:
    logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
    logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
    logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/BurstFilter.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/ThresholdFilter.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
    logging/log4j/log4j2/trunk/src/changes/changes.xml

Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java?rev=1581374&r1=1581373&r2=1581374&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
Tue Mar 25 15:31:13 2014
@@ -27,14 +27,14 @@ import org.apache.logging.log4j.spi.Stan
 /**
  * Levels used for identifying the severity of an event. Levels are organized from most specific
to least:
  * <ul>
- * <li>{@link #OFF} (most specific)</li>
- * <li>{@link #FATAL}</li>
+ * <li>{@link #OFF} (most specific, no logging)</li>
+ * <li>{@link #FATAL} (most specific, little data)</li>
  * <li>{@link #ERROR}</li>
  * <li>{@link #WARN}</li>
  * <li>{@link #INFO}</li>
  * <li>{@link #DEBUG}</li>
- * <li>{@link #TRACE}</li>
- * <li>{@link #ALL} (least specific)</li>
+ * <li>{@link #TRACE} (least specific, a lot of data)</li>
+ * <li>{@link #ALL} (least specific, all data)</li>
  * </ul>
  *
  * Typically, configuring a level in a filter or on a logger will cause logging events of
that level and those
@@ -85,7 +85,7 @@ public final class Level implements Comp
      * All events should be logged.
      */
     public static final Level ALL;
-
+    
     static {
         OFF = new Level("OFF", StandardLevel.OFF.intLevel());
         FATAL = new Level("FATAL", StandardLevel.FATAL.intLevel());
@@ -97,6 +97,11 @@ public final class Level implements Comp
         ALL = new Level("ALL", StandardLevel.ALL.intLevel());
     }
 
+    /**
+     * All levels, from most specific to least specific.
+     */
+    public static final Level[] ALL_LEVELS = {OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE,
ALL};
+
     private final String name;
     private final int intLevel;
     private final StandardLevel standardLevel;
@@ -125,65 +130,29 @@ public final class Level implements Comp
     }
 
     /**
-     * Compares this level against the level passed as an argument and returns true if this
-     * level is the same or more specific.
-     *
-     * @param level The level to test.
-     * @return True if the given Level is more specific or the same as this Level.
-     */
-    public boolean isAtLeastAsSpecificAs(final Level level) {
-        return this.intLevel <= level.intLevel;
-    }
-
-    /**
-     * Compares this level against the level passed as an argument and returns true if this
-     * level is the same or more specific.
-     *
-     * @param level The level to test.
-     * @return True if the given Level is more specific or the same as this Level.
-     */
-    public boolean isAtLeastAsSpecificAs(final int level) {
-        return this.intLevel <= level;
-    }
-
-    /**
-     * Compares the given Level against this one.
+     * Compares this level against the level passed as an argument and returns true if this
level is the same or is less
+     * specific.T
      * 
-     * @param level The level to test.
-     * @return True if the given Level is less specific or the same than this Level.
+     * @param level
+     *            The level to test.
+     * @return True if this level Level is less specific or the same as the given Level.
      */
-    public boolean isGreaterOrEqual(final int level) {
-        return this.intLevel <= level;
+    public boolean isLessSpecificThan(final Level level) {
+        return this.intLevel >= level.intLevel;
     }
 
     /**
-     * Compares the given Level against this one.
+     * Compares this level against the level passed as an argument and returns true if this
level is the same or is more
+     * specific.
      * 
-     * @param level The level to test.
-     * @return True if the given Level is less specific or the same than this Level.
-     */
-    public boolean isGreaterOrEqual(final Level level) {
-        return this.intLevel <= level.intLevel;
-    }
-
-    /**
-     * Compares the given Level against this one.
-     * @param level The level to test.
-     * @return True if the given Level is more specific or the same as this Level.
+     * @param level
+     *            The level to test.
+     * @return True if this level Level is more specific or the same as the given Level.
      */
-    public boolean isLessOrEqual(final Level level) {
+    public boolean isMoreSpecificThan(final Level level) {
         return this.intLevel <= level.intLevel;
     }
 
-    /**
-     * Compares the given Level against this one.
-     * @param level The level to test.
-     * @return True if the given Level is more specific or the same as this Level.
-     */
-    public boolean isLessOrEqual(final int level) {
-        return this.intLevel <= level;
-    }
-
     @Override
     @SuppressWarnings("CloneDoesntCallSuperClone")
     public Level clone() throws CloneNotSupportedException {

Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java?rev=1581374&r1=1581373&r2=1581374&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
Tue Mar 25 15:31:13 2014
@@ -192,7 +192,7 @@ public final class StatusLogger extends 
         }
         if (listeners.size() > 0) {
             for (final StatusListener listener : listeners) {
-                if (data.getLevel().isAtLeastAsSpecificAs(listener.getStatusLevel())) {
+                if (data.getLevel().isMoreSpecificThan(listener.getStatusLevel())) {
                     listener.log(data);
                 }
             }

Modified: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java?rev=1581374&r1=1581373&r2=1581374&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java
Tue Mar 25 15:31:13 2014
@@ -20,6 +20,8 @@ import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
 
 /**
  *
@@ -39,4 +41,166 @@ public class LevelTest {
         assertNotNull(level);
         assertEquals(Level.ERROR, level);
     }
+
+    @Test
+    public void testIsLessSpecificThan() {
+        // Level.OFF
+        assertTrue(Level.OFF.isLessSpecificThan(Level.OFF));
+        assertFalse(Level.OFF.isLessSpecificThan(Level.FATAL));
+        assertFalse(Level.OFF.isLessSpecificThan(Level.ERROR));
+        assertFalse(Level.OFF.isLessSpecificThan(Level.WARN));
+        assertFalse(Level.OFF.isLessSpecificThan(Level.INFO));
+        assertFalse(Level.OFF.isLessSpecificThan(Level.DEBUG));
+        assertFalse(Level.OFF.isLessSpecificThan(Level.TRACE));
+        assertFalse(Level.OFF.isLessSpecificThan(Level.ALL));
+        // Level.FATAL
+        assertTrue(Level.FATAL.isLessSpecificThan(Level.OFF));
+        assertTrue(Level.FATAL.isLessSpecificThan(Level.FATAL));
+        assertFalse(Level.FATAL.isLessSpecificThan(Level.ERROR));
+        assertFalse(Level.FATAL.isLessSpecificThan(Level.WARN));
+        assertFalse(Level.FATAL.isLessSpecificThan(Level.INFO));
+        assertFalse(Level.FATAL.isLessSpecificThan(Level.DEBUG));
+        assertFalse(Level.FATAL.isLessSpecificThan(Level.TRACE));
+        assertFalse(Level.FATAL.isLessSpecificThan(Level.ALL));
+        // Level.ERROR
+        assertTrue(Level.ERROR.isLessSpecificThan(Level.OFF));
+        assertTrue(Level.ERROR.isLessSpecificThan(Level.FATAL));
+        assertTrue(Level.ERROR.isLessSpecificThan(Level.ERROR));
+        assertFalse(Level.ERROR.isLessSpecificThan(Level.WARN));
+        assertFalse(Level.ERROR.isLessSpecificThan(Level.INFO));
+        assertFalse(Level.ERROR.isLessSpecificThan(Level.DEBUG));
+        assertFalse(Level.ERROR.isLessSpecificThan(Level.TRACE));
+        assertFalse(Level.ERROR.isLessSpecificThan(Level.ALL));
+        // Level.ERROR
+        assertTrue(Level.WARN.isLessSpecificThan(Level.OFF));
+        assertTrue(Level.WARN.isLessSpecificThan(Level.FATAL));
+        assertTrue(Level.WARN.isLessSpecificThan(Level.ERROR));
+        assertTrue(Level.WARN.isLessSpecificThan(Level.WARN));
+        assertFalse(Level.WARN.isLessSpecificThan(Level.INFO));
+        assertFalse(Level.WARN.isLessSpecificThan(Level.DEBUG));
+        assertFalse(Level.WARN.isLessSpecificThan(Level.TRACE));
+        assertFalse(Level.WARN.isLessSpecificThan(Level.ALL));
+        // Level.WARN
+        assertTrue(Level.WARN.isLessSpecificThan(Level.OFF));
+        assertTrue(Level.WARN.isLessSpecificThan(Level.FATAL));
+        assertTrue(Level.WARN.isLessSpecificThan(Level.ERROR));
+        assertTrue(Level.WARN.isLessSpecificThan(Level.WARN));
+        assertFalse(Level.WARN.isLessSpecificThan(Level.INFO));
+        assertFalse(Level.WARN.isLessSpecificThan(Level.DEBUG));
+        assertFalse(Level.WARN.isLessSpecificThan(Level.TRACE));
+        assertFalse(Level.WARN.isLessSpecificThan(Level.ALL));
+        // Level.INFO
+        assertTrue(Level.INFO.isLessSpecificThan(Level.OFF));
+        assertTrue(Level.INFO.isLessSpecificThan(Level.FATAL));
+        assertTrue(Level.INFO.isLessSpecificThan(Level.ERROR));
+        assertTrue(Level.INFO.isLessSpecificThan(Level.WARN));
+        assertTrue(Level.INFO.isLessSpecificThan(Level.INFO));
+        assertFalse(Level.INFO.isLessSpecificThan(Level.DEBUG));
+        assertFalse(Level.INFO.isLessSpecificThan(Level.TRACE));
+        assertFalse(Level.INFO.isLessSpecificThan(Level.ALL));
+        // Level.DEBUG
+        assertTrue(Level.DEBUG.isLessSpecificThan(Level.OFF));
+        assertTrue(Level.DEBUG.isLessSpecificThan(Level.FATAL));
+        assertTrue(Level.DEBUG.isLessSpecificThan(Level.ERROR));
+        assertTrue(Level.DEBUG.isLessSpecificThan(Level.WARN));
+        assertTrue(Level.DEBUG.isLessSpecificThan(Level.INFO));
+        assertTrue(Level.DEBUG.isLessSpecificThan(Level.DEBUG));
+        assertFalse(Level.DEBUG.isLessSpecificThan(Level.TRACE));
+        assertFalse(Level.DEBUG.isLessSpecificThan(Level.ALL));
+        // Level.TRACE
+        assertTrue(Level.TRACE.isLessSpecificThan(Level.OFF));
+        assertTrue(Level.TRACE.isLessSpecificThan(Level.FATAL));
+        assertTrue(Level.TRACE.isLessSpecificThan(Level.ERROR));
+        assertTrue(Level.TRACE.isLessSpecificThan(Level.WARN));
+        assertTrue(Level.TRACE.isLessSpecificThan(Level.INFO));
+        assertTrue(Level.TRACE.isLessSpecificThan(Level.DEBUG));
+        assertTrue(Level.TRACE.isLessSpecificThan(Level.TRACE));
+        assertFalse(Level.TRACE.isLessSpecificThan(Level.ALL));
+        // Level.ALL
+        assertTrue(Level.ALL.isLessSpecificThan(Level.OFF));
+        assertTrue(Level.ALL.isLessSpecificThan(Level.FATAL));
+        assertTrue(Level.ALL.isLessSpecificThan(Level.ERROR));
+        assertTrue(Level.ALL.isLessSpecificThan(Level.WARN));
+        assertTrue(Level.ALL.isLessSpecificThan(Level.INFO));
+        assertTrue(Level.ALL.isLessSpecificThan(Level.DEBUG));
+        assertTrue(Level.ALL.isLessSpecificThan(Level.TRACE));
+        assertTrue(Level.ALL.isLessSpecificThan(Level.ALL));
+    }
+
+    @Test
+    public void testIsMoreSpecificThan() {
+        // Level.OFF
+        assertTrue(Level.OFF.isMoreSpecificThan(Level.OFF));
+        assertTrue(Level.OFF.isMoreSpecificThan(Level.FATAL));
+        assertTrue(Level.OFF.isMoreSpecificThan(Level.ERROR));
+        assertTrue(Level.OFF.isMoreSpecificThan(Level.WARN));
+        assertTrue(Level.OFF.isMoreSpecificThan(Level.INFO));
+        assertTrue(Level.OFF.isMoreSpecificThan(Level.DEBUG));
+        assertTrue(Level.OFF.isMoreSpecificThan(Level.TRACE));
+        assertTrue(Level.OFF.isMoreSpecificThan(Level.ALL));
+        // Level.FATAL
+        assertFalse(Level.FATAL.isMoreSpecificThan(Level.OFF));
+        assertTrue(Level.FATAL.isMoreSpecificThan(Level.FATAL));
+        assertTrue(Level.FATAL.isMoreSpecificThan(Level.ERROR));
+        assertTrue(Level.FATAL.isMoreSpecificThan(Level.WARN));
+        assertTrue(Level.FATAL.isMoreSpecificThan(Level.INFO));
+        assertTrue(Level.FATAL.isMoreSpecificThan(Level.DEBUG));
+        assertTrue(Level.FATAL.isMoreSpecificThan(Level.TRACE));
+        assertTrue(Level.FATAL.isMoreSpecificThan(Level.ALL));
+        // Level.ERROR
+        assertFalse(Level.ERROR.isMoreSpecificThan(Level.OFF));
+        assertFalse(Level.ERROR.isMoreSpecificThan(Level.FATAL));
+        assertTrue(Level.ERROR.isMoreSpecificThan(Level.ERROR));
+        assertTrue(Level.ERROR.isMoreSpecificThan(Level.WARN));
+        assertTrue(Level.ERROR.isMoreSpecificThan(Level.INFO));
+        assertTrue(Level.ERROR.isMoreSpecificThan(Level.DEBUG));
+        assertTrue(Level.ERROR.isMoreSpecificThan(Level.TRACE));
+        assertTrue(Level.ERROR.isMoreSpecificThan(Level.ALL));
+        // Level.WARN
+        assertFalse(Level.WARN.isMoreSpecificThan(Level.OFF));
+        assertFalse(Level.WARN.isMoreSpecificThan(Level.FATAL));
+        assertFalse(Level.WARN.isMoreSpecificThan(Level.ERROR));
+        assertTrue(Level.WARN.isMoreSpecificThan(Level.WARN));
+        assertTrue(Level.WARN.isMoreSpecificThan(Level.INFO));
+        assertTrue(Level.WARN.isMoreSpecificThan(Level.DEBUG));
+        assertTrue(Level.WARN.isMoreSpecificThan(Level.TRACE));
+        assertTrue(Level.WARN.isMoreSpecificThan(Level.ALL));
+        // Level.INFO
+        assertFalse(Level.INFO.isMoreSpecificThan(Level.OFF));
+        assertFalse(Level.INFO.isMoreSpecificThan(Level.FATAL));
+        assertFalse(Level.INFO.isMoreSpecificThan(Level.ERROR));
+        assertFalse(Level.INFO.isMoreSpecificThan(Level.WARN));
+        assertTrue(Level.INFO.isMoreSpecificThan(Level.INFO));
+        assertTrue(Level.INFO.isMoreSpecificThan(Level.DEBUG));
+        assertTrue(Level.INFO.isMoreSpecificThan(Level.TRACE));
+        assertTrue(Level.INFO.isMoreSpecificThan(Level.ALL));
+        // Level.DEBUG
+        assertFalse(Level.DEBUG.isMoreSpecificThan(Level.OFF));
+        assertFalse(Level.DEBUG.isMoreSpecificThan(Level.FATAL));
+        assertFalse(Level.DEBUG.isMoreSpecificThan(Level.ERROR));
+        assertFalse(Level.DEBUG.isMoreSpecificThan(Level.WARN));
+        assertFalse(Level.DEBUG.isMoreSpecificThan(Level.INFO));
+        assertTrue(Level.DEBUG.isMoreSpecificThan(Level.DEBUG));
+        assertTrue(Level.DEBUG.isMoreSpecificThan(Level.TRACE));
+        assertTrue(Level.DEBUG.isMoreSpecificThan(Level.ALL));
+        // Level.TRACE
+        assertFalse(Level.TRACE.isMoreSpecificThan(Level.OFF));
+        assertFalse(Level.TRACE.isMoreSpecificThan(Level.FATAL));
+        assertFalse(Level.TRACE.isMoreSpecificThan(Level.ERROR));
+        assertFalse(Level.TRACE.isMoreSpecificThan(Level.WARN));
+        assertFalse(Level.TRACE.isMoreSpecificThan(Level.INFO));
+        assertFalse(Level.TRACE.isMoreSpecificThan(Level.DEBUG));
+        assertTrue(Level.TRACE.isMoreSpecificThan(Level.TRACE));
+        assertTrue(Level.TRACE.isMoreSpecificThan(Level.ALL));
+        // Level.ALL
+        assertFalse(Level.ALL.isMoreSpecificThan(Level.OFF));
+        assertFalse(Level.ALL.isMoreSpecificThan(Level.FATAL));
+        assertFalse(Level.ALL.isMoreSpecificThan(Level.ERROR));
+        assertFalse(Level.ALL.isMoreSpecificThan(Level.WARN));
+        assertFalse(Level.ALL.isMoreSpecificThan(Level.INFO));
+        assertFalse(Level.ALL.isMoreSpecificThan(Level.DEBUG));
+        assertFalse(Level.ALL.isMoreSpecificThan(Level.TRACE));
+        assertTrue(Level.ALL.isMoreSpecificThan(Level.ALL));
+    }
+
 }

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/BurstFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/BurstFilter.java?rev=1581374&r1=1581373&r2=1581374&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/BurstFilter.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/BurstFilter.java
Tue Mar 25 15:31:13 2014
@@ -118,7 +118,7 @@ public final class BurstFilter extends A
      * @return The onMatch value if the filter passes, onMismatch otherwise.
      */
     private Result filter(final Level level) {
-        if (this.level.isAtLeastAsSpecificAs(level)) {
+        if (this.level.isMoreSpecificThan(level)) {
             LogDelay delay = history.poll();
             while (delay != null) {
                 available.add(delay);

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java?rev=1581374&r1=1581373&r2=1581374&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/DynamicThresholdFilter.java
Tue Mar 25 15:31:13 2014
@@ -85,7 +85,7 @@ public final class DynamicThresholdFilte
             if (ctxLevel == null) {
                 ctxLevel = defaultThreshold;
             }
-            return level.isAtLeastAsSpecificAs(ctxLevel) ? onMatch : onMismatch;
+            return level.isMoreSpecificThan(ctxLevel) ? onMatch : onMismatch;
         }
         return Result.NEUTRAL;
 

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/ThresholdFilter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/ThresholdFilter.java?rev=1581374&r1=1581373&r2=1581374&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/ThresholdFilter.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/ThresholdFilter.java
Tue Mar 25 15:31:13 2014
@@ -67,7 +67,7 @@ public final class ThresholdFilter exten
     }
 
     private Result filter(final Level level) {
-        return level.isAtLeastAsSpecificAs(this.level) ? onMatch : onMismatch;
+        return level.isMoreSpecificThan(this.level) ? onMatch : onMismatch;
     }
 
     @Override

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java?rev=1581374&r1=1581373&r2=1581374&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/HTMLLayout.java
Tue Mar 25 15:31:13 2014
@@ -135,7 +135,7 @@ public final class HTMLLayout extends Ab
             sbuf.append("<font color=\"#339933\">");
             sbuf.append(Transform.escapeHtmlTags(String.valueOf(event.getLevel())));
             sbuf.append("</font>");
-        } else if (event.getLevel().isAtLeastAsSpecificAs(Level.WARN)) {
+        } else if (event.getLevel().isMoreSpecificThan(Level.WARN)) {
             sbuf.append("<font color=\"#993300\"><strong>");
             sbuf.append(Transform.escapeHtmlTags(String.valueOf(event.getLevel())));
             sbuf.append("</strong></font>");

Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1581374&r1=1581373&r2=1581374&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/src/changes/changes.xml (original)
+++ logging/log4j/log4j2/trunk/src/changes/changes.xml Tue Mar 25 15:31:13 2014
@@ -22,7 +22,7 @@
   <body>
     <release version="2.0-rc2" date="2014-MM-DD" description="Bug fixes and enhancements">
       <action issue="LOG4J2-579" dev="ggregory" type="fix">
-          Rename Level.lessOrEqual() to isLessOrEqual().
+          Rework Level comparison APIs.
       </action>
       <action issue="LOG4J2-576" dev="ggregory" type="add">
           Add org.apache.logging.log4j.Logger.getLevel().



Mime
View raw message