logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1405117 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
Date Fri, 02 Nov 2012 19:25:11 GMT
Author: ggregory
Date: Fri Nov  2 19:25:10 2012
New Revision: 1405117

URL: http://svn.apache.org/viewvc?rev=1405117&view=rev
Log:
Implement ISO8601_BASIC.

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

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java?rev=1405117&r1=1405116&r2=1405117&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/pattern/DatePatternConverter.java
Fri Nov  2 19:25:10 2012
@@ -57,11 +57,21 @@ public final class DatePatternConverter 
     private static final String ISO8601_FORMAT = "ISO8601";
     
     /**
+     * ISO8601_BASIC string literal.
+     */
+    private static final String ISO8601_BASIC_FORMAT = "ISO8601_BASIC";
+    
+    /**
      * SimpleTimePattern for ISO8601.
      */
     private static final String ISO8601_PATTERN = "yyyy-MM-dd HH:mm:ss,SSS";
     
     /**
+     * SimpleTimePattern for ISO8601_BASIC.
+     */
+    private static final String ISO8601_BASIC_PATTERN = "yyyyMMdd HHmmss,SSS";
+    
+    /**
      * Date format.
      */
     private String cachedDate;
@@ -92,6 +102,8 @@ public final class DatePatternConverter 
 
         if (patternOption == null || patternOption.equalsIgnoreCase(ISO8601_FORMAT)) {
             pattern = ISO8601_PATTERN;
+        } else if (patternOption.equalsIgnoreCase(ISO8601_BASIC_FORMAT)) {
+            pattern = ISO8601_BASIC_PATTERN;
         } else if (patternOption.equalsIgnoreCase(ABSOLUTE_FORMAT)) {
             pattern = ABSOLUTE_TIME_PATTERN;
         } else if (patternOption.equalsIgnoreCase(DATE_AND_TIME_FORMAT)) {



Mime
View raw message