cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clecl...@apache.org
Subject svn commit: r941080 - /cxf/trunk/common/common/src/main/java/org/apache/cxf/common/logging/Slf4jLogger.java
Date Tue, 04 May 2010 22:37:25 GMT
Author: cleclerc
Date: Tue May  4 22:37:24 2010
New Revision: 941080

URL: http://svn.apache.org/viewvc?rev=941080&view=rev
Log:
[CXF-2751] Fix erroneous optimization

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/common/logging/Slf4jLogger.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/common/logging/Slf4jLogger.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/logging/Slf4jLogger.java?rev=941080&r1=941079&r2=941080&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/common/logging/Slf4jLogger.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/common/logging/Slf4jLogger.java Tue
May  4 22:37:24 2010
@@ -56,20 +56,16 @@ public class Slf4jLogger extends Abstrac
     @Override
     public Level getLevel() {
         Level level;
-        /*
-         * As we can use a "switch ... case" block but only a "if ... else if ..." block,
the order of the
-         * comparisons is important. We assume the the logging framework is most probably
configured at WARN
-         * DEBUG, TRACE, INFO, ... levels
-         */
-        if (logger.isWarnEnabled()) {
-            level = Level.WARNING;
+        // Verify from the wider (trace) to the narrower (error)
+        if (logger.isTraceEnabled()) {
+            level = Level.FINER; // FINEST
         } else if (logger.isDebugEnabled()) {
             // map to the lowest between FINER, FINE and CONFIG
             level = Level.FINER;
-        } else if (logger.isTraceEnabled()) {
-            level = Level.FINEST;
         } else if (logger.isInfoEnabled()) {
             level = Level.INFO;
+        } else if (logger.isWarnEnabled()) {
+            level = Level.WARNING;
         } else if (logger.isErrorEnabled()) {
             level = Level.SEVERE;
         } else {



Mime
View raw message