From 4f3c4103e1bbfd9392aa5b3780de25a385b7f1ba Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Thu, 16 Dec 2010 22:01:07 +0100 Subject: [PATCH] Remove unneeded logging methods. --- framework/Share/lib/Horde/Share/Base.php | 44 -------------------------------- framework/Share/lib/Horde/Share/Sql.php | 6 ++--- 2 files changed, 3 insertions(+), 47 deletions(-) diff --git a/framework/Share/lib/Horde/Share/Base.php b/framework/Share/lib/Horde/Share/Base.php index 7dd23a78b..fa29830f0 100644 --- a/framework/Share/lib/Horde/Share/Base.php +++ b/framework/Share/lib/Horde/Share/Base.php @@ -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); - } - } diff --git a/framework/Share/lib/Horde/Share/Sql.php b/framework/Share/lib/Horde/Share/Sql.php index 6bb7869d9..287f738ba 100644 --- a/framework/Share/lib/Horde/Share/Sql.php +++ b/framework/Share/lib/Horde/Share/Sql.php @@ -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) . ')'; -- 2.11.0