/** * Builds a response for an exception * @param \Exception $exception * @return \PHPixie\HTTP\Responses\Response */ public function process($exception) { $templateName = $this->configData->getRequired('template'); $trace = $this->debug->exceptionTrace($exception); $body = $this->template->render($templateName, array('exception' => $exception, 'trace' => $trace, 'logger' => $this->debug->logger())); return $this->http->responses()->response($body, array(), 500); }
/** * @covers ::<protected> * @runInSeparateProcess */ public function testNotBuiltException() { $this->assertException(function () { \PHPixie\Debug::dump(5); }, '\\PHPixie\\Debug\\Exception'); }
public function c() { Debug::trace(); }
public function a($string, $num) { //Note how the trace //Will contain function parameters Debug::logTrace(); }
<?php require_once 'vendor/autoload.php'; use PHPixie\Debug; $debug = new Debug(); //Passing 'true' here will enable printing logs //automatically after the end of script execution. //This is very useful if your code relies //on exit() calls $debug->registerHandlers(true); Debug::log("test"); echo "Logged messages will be printed now";
/** * Debug component logger * @return \PHPixie\Debug\Logger */ public function logger() { return $this->debug->logger(); }