add hasLevel() for checking for an existing log level
authorChuck Hagenbuch <chuck@horde.org>
Thu, 24 Sep 2009 15:06:49 +0000 (11:06 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Thu, 24 Sep 2009 15:07:06 +0000 (11:07 -0400)
framework/Log/lib/Horde/Log/Logger.php

index 8adcc65..eb3fb98 100644 (file)
@@ -140,6 +140,17 @@ class Horde_Log_Logger
     }
 
     /**
+     * Does this logger have the level $name already?
+     *
+     * @param string   $name   The level name to check for
+     * @return boolean Whether the logger already has the specific level name
+     */
+    public function hasLevel($name)
+    {
+        return array_search($name, $this->_levels);
+    }
+
+    /**
      * Add a custom log level
      *
      * @param  string  $name    Name of level