[logback-dev] svn commit: r2103 - in logback/trunk: logback-access/src/main/java/ch/qos/logback/access/joran logback-classic/src/main/java/ch/qos/logback/classic/joran logback-classic/src/test/input/joran logback-classic/src/test/java/ch/qos/logback/classic/joran logback-core/src/main/java/ch/qos/logback/core/joran/action

noreply.ceki at qos.ch noreply.ceki at qos.ch
Fri Dec 26 15:43:01 CET 2008


Author: ceki
Date: Fri Dec 26 15:43:01 2008
New Revision: 2103

Removed:
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/MatcherAction.java
Modified:
   logback/trunk/logback-access/src/main/java/ch/qos/logback/access/joran/JoranConfigurator.java
   logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/joran/JoranConfigurator.java
   logback/trunk/logback-classic/src/test/input/joran/callerData.xml
   logback/trunk/logback-classic/src/test/input/joran/simpleEvaluator.xml
   logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/joran/EvaluatorJoranTest.java

Log:
- MatcherAction no longer needed to add matcher to an evaluator

Modified: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/joran/JoranConfigurator.java
==============================================================================
--- logback/trunk/logback-access/src/main/java/ch/qos/logback/access/joran/JoranConfigurator.java	(original)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/joran/JoranConfigurator.java	Fri Dec 26 15:43:01 2008
@@ -16,7 +16,6 @@
 import ch.qos.logback.access.sift.SiftAction;
 import ch.qos.logback.core.joran.JoranConfiguratorBase;
 import ch.qos.logback.core.joran.action.AppenderRefAction;
-import ch.qos.logback.core.joran.action.MatcherAction;
 import ch.qos.logback.core.joran.action.NOPAction;
 import ch.qos.logback.core.joran.spi.Pattern;
 import ch.qos.logback.core.joran.spi.RuleStore;
@@ -40,8 +39,6 @@
     rs.addRule(new Pattern("configuration/appender/sift/*"), new NOPAction());
     
     rs.addRule(new Pattern("*/evaluator"), new EvaluatorAction());
-    rs.addRule(new Pattern("*/evaluator/matcher"), new MatcherAction());
-
   }
 
 

Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/joran/JoranConfigurator.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/joran/JoranConfigurator.java	(original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/joran/JoranConfigurator.java	Fri Dec 26 15:43:01 2008
@@ -25,7 +25,6 @@
 import ch.qos.logback.core.joran.JoranConfiguratorBase;
 import ch.qos.logback.core.joran.action.AppenderRefAction;
 import ch.qos.logback.core.joran.action.IncludeAction;
-import ch.qos.logback.core.joran.action.MatcherAction;
 import ch.qos.logback.core.joran.action.NOPAction;
 import ch.qos.logback.core.joran.spi.Pattern;
 import ch.qos.logback.core.joran.spi.RuleStore;
@@ -50,8 +49,6 @@
     rs.addRule(new Pattern("configuration/contextName"), new ContextNameAction());
     rs.addRule(new Pattern("configuration/insertFromJNDI"), new InsertFromJNDIAction());
     rs.addRule(new Pattern("*/evaluator"), new EvaluatorAction());
-    rs.addRule(new Pattern("*/evaluator/matcher"),
-        new MatcherAction());
 
     rs.addRule(new Pattern("configuration/appender/sift"), new SiftAction());
     rs.addRule(new Pattern("configuration/appender/sift/*"), new NOPAction());

Modified: logback/trunk/logback-classic/src/test/input/joran/callerData.xml
==============================================================================
--- logback/trunk/logback-classic/src/test/input/joran/callerData.xml	(original)
+++ logback/trunk/logback-classic/src/test/input/joran/callerData.xml	Fri Dec 26 15:43:01 2008
@@ -5,7 +5,8 @@
 
   <evaluator name="helloEval">
     <Expression>m.matches(message)</Expression>
-    <matcher name="m">
+    <matcher>
+      <name>m</name>
       <regex>^hello.*</regex>
       <CaseSensitive>false</CaseSensitive>
     </matcher>  

Modified: logback/trunk/logback-classic/src/test/input/joran/simpleEvaluator.xml
==============================================================================
--- logback/trunk/logback-classic/src/test/input/joran/simpleEvaluator.xml	(original)
+++ logback/trunk/logback-classic/src/test/input/joran/simpleEvaluator.xml	Fri Dec 26 15:43:01 2008
@@ -7,7 +7,8 @@
 
    <Expression>m.matches(message)</Expression>
 
-   <matcher name="m">
+   <matcher>
+     <Name>m</Name>
      <regex>^hello.*</regex>
      <CaseSensitive>false</CaseSensitive>
    </matcher>

Modified: logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/joran/EvaluatorJoranTest.java
==============================================================================
--- logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/joran/EvaluatorJoranTest.java	(original)
+++ logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/joran/EvaluatorJoranTest.java	Fri Dec 26 15:43:01 2008
@@ -9,6 +9,7 @@
  */
 package ch.qos.logback.classic.joran;
 
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
@@ -41,16 +42,15 @@
     
     Map evalMap = (Map) loggerContext.getObject(CoreConstants.EVALUATOR_MAP);
     assertNotNull(evalMap);
-    //StatusPrinter.print(loggerContext.getStatusManager());
     JaninoEventEvaluator evaluator = (JaninoEventEvaluator) evalMap.get("msgEval");
     assertNotNull(evaluator);
     
     Logger logger = loggerContext.getLogger("xx");
-    LoggingEvent event = new LoggingEvent("foo", logger, Level.DEBUG, "Hello world", null, null);
-    //StatusPrinter.print(loggerContext.getStatusManager());
-    assertTrue(evaluator.evaluate(event));
+    LoggingEvent event0 = new LoggingEvent("foo", logger, Level.DEBUG, "Hello world", null, null);
+    assertTrue(evaluator.evaluate(event0));
     
-    //StatusPrinter.print(loggerContext.getStatusManager());
+    LoggingEvent event1 = new LoggingEvent("foo", logger, Level.DEBUG, "random blurb", null, null);
+    assertFalse(evaluator.evaluate(event1));
   }
   
   @Test


More information about the logback-dev mailing list