improves isLogLevel
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 5 Aug 2015 12:14:40 +0000 (14:14 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 5 Aug 2015 17:48:15 +0000 (19:48 +0200)
* removes redundant loglevel fetching from config
* checks for logLevel 0

Change-Id: I1f9a84184584e7fa36fc4100238a52e74cc1ed01
Reviewed-on: http://gerrit.tine20.com/customers/2089
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Core.php

index d751769..a9ee351 100644 (file)
@@ -183,7 +183,7 @@ class Tinebase_Core
      * 
      * @var int
      */
-    protected static $logLevel;
+    protected static $logLevel = null;
     
     /******************************* DISPATCH *********************************/
     
@@ -1364,12 +1364,11 @@ class Tinebase_Core
      */
     public static function isLogLevel($_prio)
     {
-        if (!isset(self::$logLevel)) {
-            $config = self::getConfig();
-            
-            self::$logLevel = Tinebase_Log::getMaxLogLevel(isset($config->logger) ? $config->logger : NULL);
+        if (! isset(self::$logLevel) || self::$logLevel === 0 ) {
+            self::$logLevel = self::getLogLevel();
+            Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ .' Setting loglevel to ' . self::$logLevel);
         }
-        
+
         return self::$logLevel >= $_prio;
     }