MFB: Log Sieve communication with DEBUG log level.
authorJan Schneider <jan@horde.org>
Thu, 5 Nov 2009 10:56:18 +0000 (11:56 +0100)
committerJan Schneider <jan@horde.org>
Thu, 5 Nov 2009 10:56:34 +0000 (11:56 +0100)
ingo/docs/CHANGES
ingo/lib/Driver/Timsieved.php

index 0fb5491..1bdae70 100644 (file)
@@ -10,6 +10,7 @@ v2.0-git
 v1.2.3-cvs
 ----------
 
+[jan] Log Sieve communication with DEBUG log level.
 [jan] Fix Oracle SQL scripts.
 [jan] Add Croatian translation (Matej Vela <matej.vela@carnet.hr>).
 [jan] Add PostgreSQL-specific upgrade script (Request #8630).
index d600b8d..816c376 100644 (file)
@@ -71,11 +71,23 @@ class Ingo_Driver_Timsieved extends Ingo_Driver
             unset($this->_sieve);
             return $res;
         } else {
+            $this->_sieve->setDebug(true, array($this, '_debug'));
             return true;
         }
     }
 
     /**
+     * Routes the Sieve protocol log to the Horde log.
+     *
+     * @param Net_Sieve $sieve  A Net_Sieve object.
+     * @param string $message   The tracked Sieve communication.
+     */
+    function _debug($sieve, $message)
+    {
+        Horde::logMessage($message, __FILE__, __LINE__, PEAR_LOG_DEBUG);
+    }
+
+    /**
      * Sets a script running on the backend.
      *
      * @param string $script  The sieve script.