[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.29-12-g663030a

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Mon Jul 18 22:32:46 CEST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Logback: the generic, reliable, fast and flexible logging framework.".

The branch, master has been updated
       via  663030a72343a85e43599339f5a00cb9ccde45c4 (commit)
       via  f91238966fb8f8dd1e38ce376d9f3246639653cf (commit)
      from  6e98d1bb0c1c728aafaf64846207603b0f482946 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=663030a72343a85e43599339f5a00cb9ccde45c4
http://github.com/ceki/logback/commit/663030a72343a85e43599339f5a00cb9ccde45c4

commit 663030a72343a85e43599339f5a00cb9ccde45c4
Merge: 6e98d1b f912389
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Mon Jul 18 13:16:21 2011 -0700

    Merge pull request #19 from dlibby00/master
    
    FIx for LBCORE-214


http://git.qos.ch/gitweb/?p=logback.git;a=commit;h=f91238966fb8f8dd1e38ce376d9f3246639653cf
http://github.com/ceki/logback/commit/f91238966fb8f8dd1e38ce376d9f3246639653cf

commit f91238966fb8f8dd1e38ce376d9f3246639653cf
Author: Derek Libby <dlibby at deng-dlibb.localdomain>
Date:   Fri Jul 15 11:48:12 2011 -0400

    Fix for:
    
        http://jira.qos.ch/browse/LBCORE-214
    
    I took the simple route and handled only the case that applies immediately to the issue mentioned in the bug.  I made no attempt to handle literal single quotes as thas would complicate the parsing needlessly.

diff --git a/logback-core/src/main/java/ch/qos/logback/core/rolling/helper/SequenceToRegex4SDF.java b/logback-core/src/main/java/ch/qos/logback/core/rolling/helper/SequenceToRegex4SDF.java
index f7e6ac7..a63b22e 100644
--- a/logback-core/src/main/java/ch/qos/logback/core/rolling/helper/SequenceToRegex4SDF.java
+++ b/logback-core/src/main/java/ch/qos/logback/core/rolling/helper/SequenceToRegex4SDF.java
@@ -69,6 +69,11 @@ class SequenceToRegex4SDF {
       return "\\.";
     case '\\': 
       throw new IllegalStateException("Forward slashes are not allowed");
+    case '\'':
+      if (occurrences == 1) {
+        return "";
+      }
+      throw new IllegalStateException("Too many single quotes");
     default:
       if (occurrences == 1) {
         return "" + c;
@@ -86,4 +91,4 @@ class SequenceToRegex4SDF {
   private String number(int occurences) {
     return "\\d{" + occurrences + "}";
   }
-}
\ No newline at end of file
+}
diff --git a/logback-core/src/test/java/ch/qos/logback/core/rolling/helper/FileNamePatternTest.java b/logback-core/src/test/java/ch/qos/logback/core/rolling/helper/FileNamePatternTest.java
index 3c4fbb6..7f069cf 100644
--- a/logback-core/src/test/java/ch/qos/logback/core/rolling/helper/FileNamePatternTest.java
+++ b/logback-core/src/test/java/ch/qos/logback/core/rolling/helper/FileNamePatternTest.java
@@ -126,12 +126,17 @@ public class FileNamePatternTest {
 
   @Test
   public void asRegex() {
-    Calendar cal = Calendar.getInstance();
-    cal.set(2003, 4, 20, 17, 55);
-    FileNamePattern fnp = new FileNamePattern("foo-%d{yyyy.MM.dd}-%i.txt",
-        context);
-    String regex = fnp.toRegex();
-    assertEquals("foo-\\d{4}\\.\\d{2}\\.\\d{2}-\\d{1,2}.txt", regex);
+    {
+      FileNamePattern fnp = new FileNamePattern("foo-%d{yyyy.MM.dd}-%i.txt",
+          context);
+      String regex = fnp.toRegex();
+      assertEquals("foo-\\d{4}\\.\\d{2}\\.\\d{2}-\\d{1,2}.txt", regex);
+    }
+    {
+      FileNamePattern fnp = new FileNamePattern("foo-%d{yyyy.MM.dd'T'}-%i.txt",
+          context);
+      String regex = fnp.toRegex();
+      assertEquals("foo-\\d{4}\\.\\d{2}\\.\\d{2}T-\\d{1,2}.txt", regex);
+    }
   }
-
 }

-----------------------------------------------------------------------

Summary of changes:
 .../core/rolling/helper/SequenceToRegex4SDF.java   |    7 ++++++-
 .../core/rolling/helper/FileNamePatternTest.java   |   19 ++++++++++++-------
 2 files changed, 18 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
Logback: the generic, reliable, fast and flexible logging framework.


More information about the logback-dev mailing list