/** * Handles the given error by printing it as HTML. * @param CoreXEngine\Util\Logger\Log $log record to handle * @return void */ public function handle(Log $log) { print '<div style="background-color:#fcc; border:1px solid #f00; padding: 4px;"><b>' . "{$log->getLevelAsString()}</b>: " . ($log->getMessage() ? $log->getMessage() . " " : "") . "<b>{$log->getExceptionName()}</b>: {$log->getException()->getMessage()} in <b>{$log->getFile()}</b>:{$log->getLine()}" . ($this->showTrace ? "<br /><pre>" . $log->getStackTraceAsString() . "</pre>" : '') . "</div><br /><br />" . PHP_EOL; }
/** * Handles the given error for the logger by printing it to stdout. * @param CoreXEngine\Util\Logger\Log $log record to handle * @return void */ public function handle(Log $log) { print $log . ($this->showTrace ? $log->getStackTraceAsString() . PHP_EOL : ''); }
/** * Handles the given error for the logger by writing it to stderr. * @param CoreXEngine\Util\Logger\Log $log record to handle * @return void */ public function handle(Log $log) { file_put_contents('php://stderr', (string) $log . ($this->showTrace ? $log->getStackTraceAsString() . PHP_EOL : '')); }