 -        $this->_indicators[$flag]
 -      );
 -      
-+    protected function callAppenders($event) {
-+      $level= $event->getLevel();
-       foreach (array_keys($this->_appenders) as $appflag) {
+-      foreach (array_keys($this->_appenders) as $appflag) {
 -        if (!($flag & $appflag)) continue;
 -        foreach (array_keys($this->_appenders[$appflag]) as $idx) {
 -          call_user_func_array(
 -            array($this->_appenders[$appflag][$idx], 'append'),
 -            $args
 -          );
++    protected function callAppenders($level, $args) {
++      $event= new LoggingEvent($this, time(), getmypid(), $level, $args);
++      foreach ($this->_appenders as $appflag => $appenders) {
 +        if (!($level & $appflag)) continue;
-+        foreach ($this->_appenders[$appflag] as $appender) {
++        foreach ($appenders as $appender) {
 +          $appender->append($event);
          }
        }
      }
-@@ -133,8 +104,8 @@
+@@ -133,8 +106,8 @@
       */
      public function finalize() {
        foreach ($this->_appenders as $flags => $appenders) {

       $args= func_get_args();
-      array_unshift($args, LogLevel::ERROR);
-      call_user_func_array(array($this, 'callAppenders'), $args);
+      $this->callAppenders(new LoggingEvent($this, time(), getmypid(), LogLevel::ERROR, $args));
     }
 
     /**
@@ -272,8 +247,9 @@
      * @param   mixed* args
      */
     public function errorf() {
+      if (!($this->flags & LogLevel::ERROR)) return;
       $args= func_get_args();
-      $this->callAppenders(LogLevel::ERROR, vsprintf($args[0], array_slice($args, 1)));
+      $this->callAppenders(new LoggingEvent($this, time(), getmypid(), LogLevel::ERROR, array(vsprintf($args[0], array_slice($args, 1)))));
     }
 
     /**
@@ -282,9 +258,9 @@
      * @param   mixed* args
      */
     public function debug() {

+      }
+      return $out;
+    }
+
+    /**
+     * Creates a string representation of this object
+     *
+     * @return  string
+     */
+    public function toString() {
+      return $this->getClassName().'("'.implode('', $this->format).'")';
+    }
+  }
+?>

