mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-23 01:26:11 +02:00
Fix level map override when using setExceptionHandler, fixes #1005
This commit is contained in:
@@ -77,7 +77,12 @@ class ErrorHandler
|
||||
public function registerExceptionHandler($levelMap = [], $callPrevious = true): self
|
||||
{
|
||||
$prev = set_exception_handler([$this, 'handleException']);
|
||||
$this->uncaughtExceptionLevelMap = array_replace($this->defaultExceptionLevelMap(), $levelMap);
|
||||
$this->uncaughtExceptionLevelMap = $levelMap;
|
||||
foreach ($this->defaultExceptionLevelMap() as $class => $level) {
|
||||
if (!isset($this->uncaughtExceptionLevelMap[$class])) {
|
||||
$this->uncaughtExceptionLevelMap[$class] = $level;
|
||||
}
|
||||
}
|
||||
if ($callPrevious && $prev) {
|
||||
$this->previousExceptionHandler = $prev;
|
||||
}
|
||||
|
Reference in New Issue
Block a user