* adjust the log format for cli mode.

This commit is contained in:
wangchunsheng
2013-02-02 03:02:50 +00:00
parent 3a3c1ac687
commit 2b97b00e8a

View File

@@ -1306,13 +1306,25 @@ class router
$trace = debug_backtrace();
extract($trace[0]);
extract($trace[1]);
$log .= ", last called by $file on $line through function $function.";
$log .= ", last called by $file on line $line through function $function.\n";
error_log($log);
/* If exit, output the error. */
if($exit)
{
if($this->config->debug) die("<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /></head><body>$log</body></html>");
if($this->config->debug)
{
if(PHP_SAPI != 'cli')
{
$htmlError = "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /></head>";
$htmlError .= "<body>$log</body></html>";
die($htmlError);
}
else
{
die($log);
}
}
die();
}
}