mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT Allowing string arguments in SS_Log::log()
This commit is contained in:
parent
5284f9019c
commit
d3be6edb4e
10
dev/Log.php
10
dev/Log.php
@ -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);
|
||||
|
@ -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'];
|
||||
|
Loading…
Reference in New Issue
Block a user