Author: fmeschbe
Date: Thu Jun 12 03:12:02 2008
New Revision: 667026

URL: http://svn.apache.org/viewvc?rev=667026&view=rev
Log:
Support log levels not being one of the defined constants in the LogService
interface: If the actual level is higher than LOG_DEBUG the message is logged
at SLF4J TRACE level. If the actual level is lower than LOG_ERROR, the message
is logged at SLF4J ERROR level.

Modified:
    
incubator/sling/trunk/commons/log/src/main/java/org/apache/sling/commons/log/LogSupport.java

Modified: 
incubator/sling/trunk/commons/log/src/main/java/org/apache/sling/commons/log/LogSupport.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/commons/log/src/main/java/org/apache/sling/commons/log/LogSupport.java?rev=667026&r1=667025&r2=667026&view=diff
==============================================================================
--- 
incubator/sling/trunk/commons/log/src/main/java/org/apache/sling/commons/log/LogSupport.java
 (original)
+++ 
incubator/sling/trunk/commons/log/src/main/java/org/apache/sling/commons/log/LogSupport.java
 Thu Jun 12 03:12:02 2008
@@ -371,6 +371,13 @@
             case LogService.LOG_ERROR:
                 log.error(message, exception);
                 break;
+            default:
+                if (logEntry.getLevel() > LogService.LOG_DEBUG) {
+                    log.trace(message, exception);
+                } else if (logEntry.getLevel() < LogService.LOG_ERROR) {
+                    log.error(message, exception);
+                }
+                break;
         }
     }
 


Reply via email to