Logger::logCaughtException PHP Method

logCaughtException() public method

public logCaughtException ( $e )
    public function logCaughtException($e)
    {
        if (!$this->log_output) {
            return;
        }
        if (method_exists($e, 'getMyTrace')) {
            $trace = $e->getMyTrace();
        } else {
            $trace = $e->getTrace();
        }
        if (isset($e->shift)) {
            $frame = $e->my_backtrace[$e->shift];
        } else {
            $frame = array('file' => 'unknown', 'line' => 'unknown');
        }
        $this->logLine($this->txtLine(get_class($e) . ': ' . $e->getMessage(), $frame), 2, 'error', $trace);
        if (method_exists($e, 'getAdditionalMessage')) {
            $this->logLine($e->getAdditionalMessage(), 2, 'error');
        }
        if (isset($e->more_info)) {
            $this->logLine("Additional information:\n" . $this->print_r($e->more_info, '', '', '* ', "\n", ' '), 2, 'error');
        }
    }