report the bad log level in the exception
authorChuck Hagenbuch <chuck@horde.org>
Wed, 3 Jun 2009 15:24:39 +0000 (11:24 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Wed, 3 Jun 2009 15:24:39 +0000 (11:24 -0400)
framework/Log/lib/Horde/Log/Logger.php

index 5a0617a..8adcc65 100644 (file)
@@ -75,11 +75,11 @@ class Horde_Log_Logger
      */
     public function __call($method, $params)
     {
-        $level = strtoupper($method);
-        if (($level = array_search($level, $this->_levels)) !== false) {
+        $levelName = strtoupper($method);
+        if (($level = array_search($levelName, $this->_levels)) !== false) {
             $this->log(array_shift($params), $level);
         } else {
-            throw new Horde_Log_Exception('Bad log level');
+            throw new Horde_Log_Exception('Bad log level ' . $levelName);
         }
     }