Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ public function __construct(array $options = null)
}

if (isset($options['exceptionhandler']) && $options['exceptionhandler'] === true) {
self::registerExceptionHandler($this);
static::registerExceptionHandler($this);
}

if (isset($options['errorhandler']) && $options['errorhandler'] === true) {
self::registerErrorHandler($this);
static::registerErrorHandler($this);
}

}
Expand Down Expand Up @@ -517,24 +517,23 @@ public static function registerErrorHandler(Logger $logger, $continueNativeHandl
return false;
}

$errorHandlerMap = static::$errorPriorityMap;
$errorPriorityMap = static::$errorPriorityMap;

$previous = set_error_handler(function ($level, $message, $file, $line, $context)
use ($logger, $errorHandlerMap, $continueNativeHandler)
$previous = set_error_handler(function ($level, $message, $file, $line)
use ($logger, $errorPriorityMap, $continueNativeHandler)
{
$iniLevel = error_reporting();

if ($iniLevel & $level) {
if (isset(Logger::$errorPriorityMap[$level])) {
$priority = $errorHandlerMap[$level];
if (isset($errorPriorityMap[$level])) {
$priority = $errorPriorityMap[$level];
} else {
$priority = Logger::INFO;
}
$logger->log($priority, $message, array(
'errno' => $level,
'file' => $file,
'line' => $line,
'context' => $context,
));
}

Expand Down

0 comments on commit d110f8d

Please sign in to comment.