logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1574209 - in /logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core: helpers/UUIDUtil.java impl/ThrowableFormatOptions.java layout/RFC5424Layout.java pattern/AnsiEscape.java pattern/LevelPatternConverter.java
Date Tue, 04 Mar 2014 21:24:56 GMT
Author: ggregory
Date: Tue Mar  4 21:24:56 2014
New Revision: 1574209

URL: http://svn.apache.org/r1574209
Log:
Reuse refactoring from [LOG4J2-561] to allow spaces around commas in Configuration's package
attribute.

Modified:
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/UUIDUtil.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptions.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
    logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/AnsiEscape.java
    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/helpers/UUIDUtil.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/UUIDUtil.java?rev=1574209&r1=1574208&r2=1574209&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/UUIDUtil.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/helpers/UUIDUtil.java
Tue Mar  4 21:24:56 2014
@@ -122,7 +122,7 @@ public final class UUIDUtil {
             if (assigned == null) {
                 sequences = new long[0];
             } else {
-                final String[] array = assigned.split(",");
+                final String[] array = assigned.split(Patterns.COMMA_SEPARATOR);
                 sequences = new long[array.length];
                 int i = 0;
                 for (final String value : array) {

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptions.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptions.java?rev=1574209&r1=1574208&r2=1574209&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptions.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableFormatOptions.java
Tue Mar  4 21:24:56 2014
@@ -21,6 +21,7 @@ import java.util.List;
 import java.util.Scanner;
 
 import org.apache.logging.log4j.core.helpers.Constants;
+import org.apache.logging.log4j.core.helpers.Patterns;
 
 /**
  * Contains options which control how a {@link Throwable} pattern is formatted.
@@ -189,7 +190,7 @@ public final class ThrowableFormatOption
         // However, the convention for multiple options should be:
         //     %xEx{["none"|"short"|"full"|depth]}[{filters(packages)}]
         if (options.length == 1 && options[0] != null && options[0].length()
> 0) {
-            final String[] opts = options[0].split(",", 2);
+            final String[] opts = options[0].split(Patterns.COMMA_SEPARATOR, 2);
             final String first = opts[0].trim();
             final Scanner scanner = new Scanner(first);
             if (opts.length > 1 && (first.equalsIgnoreCase(FULL) || first.equalsIgnoreCase(SHORT)
|| first.equalsIgnoreCase(NONE) || scanner.hasNextInt())) {
@@ -211,7 +212,7 @@ public final class ThrowableFormatOption
                 } else if (option.startsWith("filters(") && option.endsWith(")"))
{
                     final String filterStr = option.substring("filters(".length(), option.length()
- 1);
                     if (filterStr.length() > 0) {
-                        final String[] array = filterStr.split(",");
+                        final String[] array = filterStr.split(Patterns.COMMA_SEPARATOR);
                         if (array.length > 0) {
                             packages = new ArrayList<String>(array.length);
                             for (String token : array) {

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java?rev=1574209&r1=1574208&r2=1574209&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/RFC5424Layout.java
Tue Mar  4 21:24:56 2014
@@ -42,6 +42,7 @@ import org.apache.logging.log4j.core.hel
 import org.apache.logging.log4j.core.helpers.Charsets;
 import org.apache.logging.log4j.core.helpers.Integers;
 import org.apache.logging.log4j.core.helpers.NetUtils;
+import org.apache.logging.log4j.core.helpers.Patterns;
 import org.apache.logging.log4j.core.helpers.Strings;
 import org.apache.logging.log4j.core.net.Facility;
 import org.apache.logging.log4j.core.net.Priority;
@@ -142,7 +143,7 @@ public class RFC5424Layout extends Abstr
         this.localHostName = NetUtils.getLocalHostname();
         ListChecker c = null;
         if (excludes != null) {
-            final String[] array = excludes.split(",");
+            final String[] array = excludes.split(Patterns.COMMA_SEPARATOR);
             if (array.length > 0) {
                 c = new ExcludeChecker();
                 mdcExcludes = new ArrayList<String>(array.length);
@@ -156,7 +157,7 @@ public class RFC5424Layout extends Abstr
             mdcExcludes = null;
         }
         if (includes != null) {
-            final String[] array = includes.split(",");
+            final String[] array = includes.split(Patterns.COMMA_SEPARATOR);
             if (array.length > 0) {
                 c = new IncludeChecker();
                 mdcIncludes = new ArrayList<String>(array.length);
@@ -170,7 +171,7 @@ public class RFC5424Layout extends Abstr
             mdcIncludes = null;
         }
         if (required != null) {
-            final String[] array = required.split(",");
+            final String[] array = required.split(Patterns.COMMA_SEPARATOR);
             if (array.length > 0) {
                 mdcRequired = new ArrayList<String>(array.length);
                 for (final String str : array) {

Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/AnsiEscape.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/AnsiEscape.java?rev=1574209&r1=1574208&r2=1574209&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/AnsiEscape.java
(original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/AnsiEscape.java
Tue Mar  4 21:24:56 2014
@@ -256,7 +256,7 @@ public enum AnsiEscape {
      * @return a new map
      */
     public static Map<String, String> createMap(final String values, final String[]
dontEscapeKeys) {
-        return createMap(values.split(Patterns.toWhitespaceSeparator(",")), dontEscapeKeys);
+        return createMap(values.split(Patterns.COMMA_SEPARATOR), dontEscapeKeys);
     }
 
     /**

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=1574209&r1=1574208&r2=1574209&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 Mar  4 21:24:56 2014
@@ -23,6 +23,7 @@ import java.util.Map;
 import org.apache.logging.log4j.Level;
 import org.apache.logging.log4j.core.LogEvent;
 import org.apache.logging.log4j.core.config.plugins.Plugin;
+import org.apache.logging.log4j.core.helpers.Patterns;
 
 /**
  * Returns the event's level in a StringBuilder.
@@ -63,7 +64,7 @@ public final class LevelPatternConverter
         final Map<Level, String> levelMap = new HashMap<Level, String>();
         int length = Integer.MAX_VALUE; // More than the longest level name.
         boolean lowerCase = false;
-        final String[] definitions = options[0].split(",");
+        final String[] definitions = options[0].split(Patterns.COMMA_SEPARATOR);
         for (final String def : definitions) {
             final String[] pair = def.split("=");
             if (pair == null || pair.length != 2) {



Mime
View raw message