[logback-dev] [GIT] Logback: the generic, reliable, fast and flexible logging framework. branch, master, updated. v_0.9.27-6-g9fa097d

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Thu Dec 30 15:57:21 CET 2010


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  9fa097d645fe31bb057884c21c20f3e40617a8bd (commit)
      from  0ee73e69b47e35deeaa9dc02d8f003d12a2f2e72 (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=9fa097d645fe31bb057884c21c20f3e40617a8bd
http://github.com/ceki/logback/commit/9fa097d645fe31bb057884c21c20f3e40617a8bd

commit 9fa097d645fe31bb057884c21c20f3e40617a8bd
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Thu Dec 30 15:51:48 2010 +0100

    fix LBCLASSIC-238

diff --git a/logback-classic/src/main/java/ch/qos/logback/classic/boolex/GEventEvaluator.java b/logback-classic/src/main/java/ch/qos/logback/classic/boolex/GEventEvaluator.java
index 04687e2..fc9623c 100644
--- a/logback-classic/src/main/java/ch/qos/logback/classic/boolex/GEventEvaluator.java
+++ b/logback-classic/src/main/java/ch/qos/logback/classic/boolex/GEventEvaluator.java
@@ -41,6 +41,7 @@ public class GEventEvaluator extends EventEvaluatorBase<ILoggingEvent> {
   }
 
   public void start() {
+    int errors = 0;
     if (expression == null || expression.length() == 0) {
       addError("Empty expression");
       return;
@@ -54,7 +55,7 @@ public class GEventEvaluator extends EventEvaluatorBase<ILoggingEvent> {
     currentPackageName = currentPackageName.replace('.', '/');
 
     String scriptText = FileUtil.resourceAsString(this, classLoader, currentPackageName + "/EvaluatorTemplate.groovy");
-    if(scriptText == null) {
+    if (scriptText == null) {
       return;
     }
 
@@ -70,13 +71,17 @@ public class GEventEvaluator extends EventEvaluatorBase<ILoggingEvent> {
 
     } catch (CompilationFailedException cfe) {
       addError("Failed to compile expression [" + expression + "]", cfe);
+      errors++;
     } catch (Exception e) {
       addError("Failed to compile expression [" + expression + "]", e);
+      errors++;
     }
+    if (errors == 0)
+      super.start();
   }
 
   public boolean evaluate(ILoggingEvent event) throws NullPointerException, EvaluationException {
-    if(delegateEvaluator == null) {
+    if (delegateEvaluator == null) {
       return false;
     }
     return delegateEvaluator.doEvaluate(event);
diff --git a/logback-classic/src/test/java/ch/qos/logback/classic/boolex/GEventEvaluatorTest.java b/logback-classic/src/test/java/ch/qos/logback/classic/boolex/GEventEvaluatorTest.java
index 5fe551f..d482e92 100644
--- a/logback-classic/src/test/java/ch/qos/logback/classic/boolex/GEventEvaluatorTest.java
+++ b/logback-classic/src/test/java/ch/qos/logback/classic/boolex/GEventEvaluatorTest.java
@@ -10,6 +10,7 @@ import ch.qos.logback.core.CoreConstants;
 import ch.qos.logback.core.boolex.EvaluationException;
 import ch.qos.logback.core.status.StatusChecker;
 import ch.qos.logback.core.util.StatusPrinter;
+import org.junit.Before;
 import org.junit.Test;
 import org.slf4j.MDC;
 import org.slf4j.Marker;
@@ -32,6 +33,13 @@ public class GEventEvaluatorTest {
   Logger logger = context.getLogger(this.getClass());
   Marker markerA = MarkerFactory.getMarker("A");
 
+  GEventEvaluator gee = new GEventEvaluator();
+
+  @Before
+  public void setUp() {
+    gee.setContext(context);
+  }
+
   LoggingEvent makeEvent(String msg) {
     return makeEvent(Level.DEBUG, msg, null, null);
   }
@@ -41,8 +49,6 @@ public class GEventEvaluatorTest {
   }
 
   void doEvaluateAndCheck(String expression, ILoggingEvent event, boolean expected) throws EvaluationException {
-    GEventEvaluator gee = new GEventEvaluator();
-    gee.setContext(context);
     gee.setExpression(expression);
     gee.start();
 
@@ -127,10 +133,16 @@ public class GEventEvaluatorTest {
     return (end - start) / LEN;
   }
 
+
+  @Test
+  public void startMakesIsStartedReturnTrue() {
+    gee.setExpression("return true");
+    gee.start();
+    assertTrue(gee.isStarted());
+  }
+
   @Test
   public void perfTest() throws EvaluationException {
-    GEventEvaluator gee = new GEventEvaluator();
-    gee.setContext(context);
     gee.setExpression("event.timeStamp < 100 && event.message != 'xx' ");
     gee.start();
 
diff --git a/logback-site/src/site/pages/news.html b/logback-site/src/site/pages/news.html
index 178c2d8..04bbcfa 100644
--- a/logback-site/src/site/pages/news.html
+++ b/logback-site/src/site/pages/news.html
@@ -30,6 +30,11 @@
 
     <h3>January xx, 2011 - Release of version 0.9.28</h3>
 
+    <p>Fixed <a href="http://jira.qos.ch/browse/LBCLASSIC-238">issue
+    238</a> reported by Robert Elliot. <code>GEventEvaluator</code>'s
+    start method now correctly sets the state of the instance.
+    </p>
+
     <hr width="80%" align="center" />
 
     <h3>December 22nd, 2010 - Release of version 0.9.27</h3>

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

Summary of changes:
 .../logback/classic/boolex/GEventEvaluator.java    |    9 +++++++--
 .../classic/boolex/GEventEvaluatorTest.java        |   20 ++++++++++++++++----
 logback-site/src/site/pages/news.html              |    5 +++++
 3 files changed, 28 insertions(+), 6 deletions(-)


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


More information about the logback-dev mailing list