camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject svn commit: r1165739 - /camel/trunk/camel-core/src/main/java/org/apache/camel/util/CamelLogger.java
Date Tue, 06 Sep 2011 16:06:10 GMT
Author: hadrian
Date: Tue Sep  6 16:06:10 2011
New Revision: 1165739

URL: http://svn.apache.org/viewvc?rev=1165739&view=rev
Log:
Checkstyle fixes

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/CamelLogger.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/CamelLogger.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/CamelLogger.java?rev=1165739&r1=1165738&r2=1165739&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/CamelLogger.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/CamelLogger.java Tue Sep  6
16:06:10 2011
@@ -108,14 +108,6 @@ public class CamelLogger {
         this.log = LoggerFactory.getLogger(logName);
     }
 
-    public static boolean shouldLog(Logger log, LoggingLevel level) {
-        return level == LoggingLevel.DEBUG && log.isDebugEnabled() 
-            || level == LoggingLevel.ERROR && log.isErrorEnabled()
-            || level == LoggingLevel.INFO && log.isInfoEnabled()
-            || level == LoggingLevel.TRACE && log.isTraceEnabled()
-            || level == LoggingLevel.WARN && log.isWarnEnabled();
-    }
-
     public static void log(Logger log, LoggingLevel level, String message) {
         switch (level) {
         case DEBUG:
@@ -162,4 +154,20 @@ public class CamelLogger {
         return CamelLogger.shouldLog(log, level);
     }
 
+    public static boolean shouldLog(Logger log, LoggingLevel level) {
+        switch (level) {
+        case DEBUG:
+            return log.isDebugEnabled(); 
+        case ERROR:
+            return log.isErrorEnabled(); 
+        case INFO:
+            return log.isInfoEnabled(); 
+        case TRACE:
+            return log.isTraceEnabled(); 
+        case WARN:
+            return log.isWarnEnabled(); 
+        default:
+        }
+        return false;
+    }
 }



Mime
View raw message