Make sure we always have app name when logging
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 10 Jul 2009 21:56:21 +0000 (15:56 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 13 Jul 2009 19:41:47 +0000 (13:41 -0600)
framework/Core/lib/Horde.php

index aea5d79..1d1dca0 100644 (file)
@@ -106,8 +106,10 @@ class Horde
             $message = $message->getMessage();
         }
 
-        $app = isset($GLOBALS['registry']) ? $GLOBALS['registry']->getApp() : 'horde';
-        $message = '[' . $app . '] ' . $message . ' [pid ' . getmypid() . ' on line ' . $line . ' of "' . $file . '"]';
+        $app = isset($GLOBALS['registry'])
+            ? $GLOBALS['registry']->getApp()
+            : null;
+        $message = '[' . ($app ? $app : 'horde') . '] ' . $message . ' [pid ' . getmypid() . ' on line ' . $line . ' of "' . $file . '"]';
 
         /* Make sure to log in the system's locale. */
         $locale = setlocale(LC_TIME, 0);