Remove unneeded logging methods.
authorJan Schneider <jan@horde.org>
Thu, 16 Dec 2010 21:01:07 +0000 (22:01 +0100)
committerJan Schneider <jan@horde.org>
Thu, 16 Dec 2010 23:17:10 +0000 (00:17 +0100)
framework/Share/lib/Horde/Share/Base.php
framework/Share/lib/Horde/Share/Sql.php

index 7dd23a7..fa29830 100644 (file)
@@ -669,48 +669,4 @@ abstract class Horde_Share_Base
 
         return count($aParts) > count($bParts);
     }
-
-    /**
-     * Logs a debug entry
-     *
-     * @param string $sql     The log statement.
-     * @param string $name    TODO
-     * @param float $runtime  Runtime interval.
-     */
-    protected function _logDebug($entry, $name, $runtime = null)
-    {
-        /*@TODO */
-        $name = (empty($name) ? '' : $name)
-              . (empty($runtime) ? '' : sprintf(" (%.4fs)", $runtime));
-        $this->_logger->debug($this->_formatLogEntry($name, $entry));
-    }
-
-    /**
-     * Logs an error entry.
-     *
-     * @param string $error   The error statement.
-     * @param string $name    TODO
-     * @param float $runtime  Runtime interval.
-     */
-    protected function _logError($error, $name, $runtime = null)
-    {
-        /*@TODO */
-        $name = (empty($name) ? '' : $name)
-              . (empty($runtime) ? '' : sprintf(" (%.4fs)", $runtime));
-        $this->_logger->err($this->_formatLogEntry($name, $error));
-    }
-
-    /**
-     * Formats the log entry.
-     *
-     * @param string $message  Message.
-     * @param string $sql      SQL statment.
-     *
-     * @return string  Formatted log entry.
-     */
-    protected function _formatLogEntry($message, $sql)
-    {
-        return "SQL $message  \n\t" . wordwrap(preg_replace("/\s+/", ' ', $sql), 70, "\n\t  ", 1);
-    }
-
 }
index 6bb7869..287f738 100644 (file)
@@ -155,7 +155,7 @@ class Horde_Share_Sql extends Horde_Share_Base
             throw new Horde_Share_Exception($e->getMessage());
         }
         if (!$results) {
-            $this->_logError(sprintf("Share name %s not found", $name), 'NOT FOUND');
+            $this->_logger->err(sprintf('Share name %s not found', $name));
             throw new Horde_Exception_NotFound();
         }
         $data = $this->_fromDriverCharset($results);
@@ -210,7 +210,7 @@ class Horde_Share_Sql extends Horde_Share_Base
             throw new Horde_Share_Exception($e->getMessage());
         }
         if (!$results) {
-            $this->_logError(sprintf("Share name %s not found", $name), 'NOT FOUND');
+            $this->_logger->err(sprintf('Share name %s not found', $name));
             throw new Horde_Exception_NotFound();
         }
         $data = $this->_fromDriverCharset($results);
@@ -642,7 +642,7 @@ class Horde_Share_Sql extends Horde_Share_Base
                         . ' AND (' . Horde_SQL::buildClause($this->_db, 'g.perm', '&', $perm) . '))';
                 }
             } catch (Horde_Group_Exception $e) {
-                $this->_logError($e, 'Horde_Share_Sql::getShareCriteria()');
+                $this->_logger->err($e);
             }
         } else {
             $where = '(' . Horde_SQL::buildClause($this->_db, 's.perm_guest', '&', $perm) . ')';