ENHANCEMENT Allowing string arguments in SS_Log::log()

This commit is contained in:
Ingo Schommer 2011-08-23 14:34:59 +02:00
parent 5284f9019c
commit d3be6edb4e
2 changed files with 11 additions and 1 deletions

View File

@ -133,6 +133,16 @@ class SS_Log {
'errline' => $message->getLine(),
'errcontext' => $message->getTrace()
);
} elseif(is_string($message)) {
$trace = SS_Backtrace::filtered_backtrace();
$lastTrace = $trace[0];
$message = array(
'errno' => '',
'errstr' => $message,
'errfile' => @$lastTrace['file'],
'errline' => @$lastTrace['line'],
'errcontext' => $trace
);
}
try {
self::get_logger()->log($message, $priority);

View File

@ -49,7 +49,7 @@ class SS_LogErrorEmailFormatter implements Zend_Log_Formatter_Interface {
$data .= "</div>\n";
$relfile = Director::makeRelative($errfile);
if($relfile[0] == '/') $relfile = substr($relfile, 1);
if($relfile && $relfile[0] == '/') $relfile = substr($relfile, 1);
$host = @$_SERVER['HTTP_HOST'];
$uri = @$_SERVER['REQUEST_URI'];