Esempio n. 1
0
 public function errorHandler($code, $message, $file, $line, $errcontext = null)
 {
     $values = debug_backtrace();
     unset($values[0]);
     $values = array_values($values);
     $traces = [];
     if (!empty($values)) {
         $function = $this->getArrayValue($values[0], "function");
         if ($function !== "trigger_error" && $function !== "user_error") {
             $trace = new Trace();
             $trace->setFile($file);
             $trace->setLine($line);
             $traces[] = $trace;
         }
     }
     foreach ($values as $value) {
         $trace = new Trace();
         $trace->setFile($this->getArrayValue($value, "file"));
         $trace->setLine($this->getArrayValue($value, "line"));
         $trace->setFunction($this->getArrayValue($value, "function"));
         $trace->setClass($this->getArrayValue($value, "class"));
         $traces[] = $trace;
     }
     $this->log($message, $traces);
 }