N°4261 - ExceptionLog: improve readability

This commit is contained in:
bruno-ds
2021-10-21 11:07:31 +02:00
parent 62f7eca0a8
commit 5e2f8a4ea6

View File

@@ -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);
}