[slf4j-dev] svn commit: r1015 - slf4j/trunk/log4j-over-slf4j/src/main/java/org/apache/log4j

ceki at slf4j.org ceki at slf4j.org
Tue May 27 20:07:26 CEST 2008


Author: ceki
Date: Tue May 27 20:07:26 2008
New Revision: 1015

Modified:
   slf4j/trunk/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java

Log:
- fix bug 74. See also http://bugzilla.slf4j.org/show_bug.cgi?id=74

Modified: slf4j/trunk/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java
==============================================================================
--- slf4j/trunk/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java	(original)
+++ slf4j/trunk/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java	Tue May 27 20:07:26 2008
@@ -82,6 +82,30 @@
   }
 
   /**
+   * Return the level in effect for this category/logger.
+   * 
+   * <p>
+   * The result is computed by simulation.
+   * 
+   * @return
+   */
+  public Level getEffectiveLevel() {
+    if(slf4jLogger.isTraceEnabled()) {
+      return Level.TRACE;
+    }
+    if(slf4jLogger.isDebugEnabled()) {
+      return Level.DEBUG;
+    }
+    if(slf4jLogger.isInfoEnabled()) {
+      return Level.INFO;
+    }
+    if(slf4jLogger.isWarnEnabled()) {
+      return Level.WARN;
+    }
+    return Level.ERROR;
+  }
+  
+  /**
    * Delegates to {@link org.slf4j.Logger#isTraceEnabled} 
    * method of SLF4J.
    */



More information about the slf4j-dev mailing list