felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r487260 - /incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Logger.java
Date Thu, 14 Dec 2006 17:15:11 GMT
Author: rickhall
Date: Thu Dec 14 09:15:10 2006
New Revision: 487260

URL: http://svn.apache.org/viewvc?view=rev&rev=487260
Log:
Modified logger so that log level is obeyed whether a log service is
used or not.

Modified:
    incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Logger.java

Modified: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Logger.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Logger.java?view=diff&rev=487260&r1=487259&r2=487260
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Logger.java (original)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Logger.java Thu
Dec 14 09:15:10 2006
@@ -106,26 +106,23 @@
         // more conservative locking here, but let's be optimistic.
         Object[] logger = m_logger;
 
-        if (logger != null)
+        if (m_logLevel >= level)
         {
-            _logReflectively(logger, sr, level, msg, throwable);
-        }
-        else
-        {
-            String s = (sr == null) ? null : "SvcRef " + sr;
-            s = (s == null) ? msg : s + " " + msg;
-            s = (throwable == null) ? s : s + " (" + throwable + ")";
-            switch (level)
+            if (logger != null)
+            {
+                _logReflectively(logger, sr, level, msg, throwable);
+            }
+            else
             {
-                case LOG_DEBUG:
-                    if (m_logLevel >= LOG_DEBUG)
-                    {
+                String s = (sr == null) ? null : "SvcRef " + sr;
+                s = (s == null) ? msg : s + " " + msg;
+                s = (throwable == null) ? s : s + " (" + throwable + ")";
+                switch (level)
+                {
+                    case LOG_DEBUG:
                         System.out.println("DEBUG: " + s);
-                    }
-                    break;
-                case LOG_ERROR:
-                    if (m_logLevel >= LOG_ERROR)
-                    {
+                        break;
+                    case LOG_ERROR:
                         System.out.println("ERROR: " + s);
                         if (throwable != null)
                         {
@@ -136,22 +133,16 @@
                             }
                             throwable.printStackTrace();
                         }
-                    }
-                    break;
-                case LOG_INFO:
-                    if (m_logLevel >= LOG_INFO)
-                    {
+                        break;
+                    case LOG_INFO:
                         System.out.println("INFO: " + s);
-                    }
-                    break;
-                case LOG_WARNING:
-                    if (m_logLevel >= LOG_WARNING)
-                    {
+                        break;
+                    case LOG_WARNING:
                         System.out.println("WARNING: " + s);
-                    }
-                    break;
-                default:
-                    System.out.println("UNKNOWN[" + level + "]: " + s);
+                        break;
+                    default:
+                        System.out.println("UNKNOWN[" + level + "]: " + s);
+                }
             }
         }
     }



Mime
View raw message