logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1519770 - /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LevelPatternConverter.java
Date Tue, 03 Sep 2013 17:57:08 GMT
Author: ggregory
Date: Tue Sep  3 17:57:08 2013
New Revision: 1519770

URL: http://svn.apache.org/r1519770
Log:
[LOG4J2-383][Pattern Layout] Customize level name by length.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LevelPatternConverter.java

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LevelPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LevelPatternConverter.java?rev=1519770&r1=1519769&r2=1519770&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LevelPatternConverter.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LevelPatternConverter.java
Tue Sep  3 17:57:08 2013
@@ -28,6 +28,8 @@ import org.apache.logging.log4j.core.con
 @Plugin(name = "LevelPatternConverter", category = "Converter")
 @ConverterKeys({ "p", "level" })
 public final class LevelPatternConverter extends LogEventPatternConverter {
+    private static final String OPTION_LENGTH = "length";
+
     /**
      * Singleton.
      */
@@ -66,7 +68,7 @@ public final class LevelPatternConverter
             }
             final String key = pair[0].trim();
             final String value = pair[1].trim();
-            if ("length".equalsIgnoreCase(key)) {
+            if (OPTION_LENGTH.equalsIgnoreCase(key)) {
                 length = Integer.parseInt(value);
             } else {
                 final Level level = Level.toLevel(key, null);



Mime
View raw message