format($this->getDateTimeFormat()); } $output = $event['timestamp'] . ' ' . $event['priorityName'] . ' (' . $event['priority'] . ') ' . $event['message'] . ' in ' . $event['extra']['file'] . ' on line ' . $event['extra']['line']; if (! empty($event['extra']['trace'])) { $outputTrace = ''; foreach ($event['extra']['trace'] as $trace) { $outputTrace .= "File : {$trace['file']}\n" . "Line : {$trace['line']}\n" . "Func : {$trace['function']}\n" . "Class : {$trace['class']}\n" . "Type : " . $this->getType($trace['type']) . "\n" . "Args : " . print_r($trace['args'], true) . "\n"; } $output .= "\n[Trace]\n" . $outputTrace; } return $output; } /** * {@inheritDoc} */ public function getDateTimeFormat() { return $this->dateTimeFormat; } /** * {@inheritDoc} */ public function setDateTimeFormat($dateTimeFormat) { $this->dateTimeFormat = (string) $dateTimeFormat; return $this; } /** * Get the type of a function * * @param string $type * @return string */ protected function getType($type) { switch ($type) { case "::": return "static"; case "->": return "method"; default: return $type; } } }