[logback-dev] svn commit: r1423 - in logback/trunk/logback-classic/src: main/java/ch/qos/logback/classic test/java/ch/qos/logback/classic

noreply.seb at qos.ch noreply.seb at qos.ch
Mon Mar 12 17:38:56 CET 2007


Author: seb
Date: Mon Mar 12 17:38:55 2007
New Revision: 1423

Modified:
   logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/Logger.java
   logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/LoggerTest.java

Log:
Added a test case
Fixed a bug

Modified: logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/Logger.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/Logger.java	(original)
+++ logback/trunk/logback-classic/src/main/java/ch/qos/logback/classic/Logger.java	Mon Mar 12 17:38:55 2007
@@ -636,6 +636,8 @@
     FilterReply decision = callTurboFilters(level);
     if  (decision.equals(FilterReply.ACCEPT)) {
       return true;
+    } else if (decision.equals(FilterReply.DENY)) {
+      return false;
     }
     return (effectiveLevelInt <= level.levelInt);
   }

Modified: logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/LoggerTest.java
==============================================================================
--- logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/LoggerTest.java	(original)
+++ logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/LoggerTest.java	Mon Mar 12 17:38:55 2007
@@ -67,6 +67,12 @@
     assertTrue(logger.isEnabledFor(Level.INFO));
   }
   
+  public void testIsEnabledForWithNoFilter() {
+    addNoFilter();
+    logger.setLevel(Level.DEBUG);
+    assertFalse(logger.isEnabledFor(Level.INFO));
+  }
+  
   public void testIsDebugEnabledWithNoFilter() {
     addNoFilter();
     logger.setLevel(Level.DEBUG);



More information about the logback-dev mailing list