mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 09:08:42 +02:00
N°4261 - ExceptionLog: improve readability
This commit is contained in:
@@ -1315,21 +1315,13 @@ class ExceptionLog extends LogAPI
|
||||
|
||||
$sExceptionClass = get_class($oException);
|
||||
|
||||
if (empty($aContext[self::CONTEXT_EXCEPTION])) {
|
||||
$aContext[self::CONTEXT_EXCEPTION] = $oException;
|
||||
}
|
||||
|
||||
if (empty($aContext['exception class'])) {
|
||||
$aContext['exception class'] = $sExceptionClass;
|
||||
}
|
||||
|
||||
if (empty($aContext['file'])) {
|
||||
$aContext['file'] = $oException->getFile();
|
||||
}
|
||||
|
||||
if (empty($aContext['line'])) {
|
||||
$aContext['line'] = $oException->getLine();
|
||||
}
|
||||
$aDefaultValues = [
|
||||
self::CONTEXT_EXCEPTION => $oException,
|
||||
'exception class' => $sExceptionClass,
|
||||
'file' => $oException->getFile(),
|
||||
'line' => $oException->getLine(),
|
||||
];
|
||||
$aContext = array_merge($aDefaultValues, $aContext);
|
||||
|
||||
parent::Log($sLevel, $oException->getMessage(), $sExceptionClass, $aContext);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user