1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-08 14:16:42 +02:00

Fix a wrong check on Error Handler and removed an old bug

This commit is contained in:
George Mponos
2018-12-10 22:27:29 +02:00
parent a774caa99f
commit ef83e0647e

View File

@@ -58,9 +58,6 @@ class ErrorHandler
*/
public static function register(LoggerInterface $logger, $errorLevelMap = [], $exceptionLevelMap = [], $fatalLevel = null): self
{
//Forces the autoloader to run for LogLevel. Fixes an autoload issue at compile-time on PHP5.3. See https://github.com/Seldaek/monolog/pull/929
class_exists('\\Psr\\Log\\LogLevel', true);
$handler = new static($logger);
if ($errorLevelMap !== false) {
$handler->registerErrorHandler($errorLevelMap);
@@ -150,6 +147,7 @@ class ErrorHandler
/**
* @private
* @param \Exception $e
*/
public function handleException($e)
{
@@ -171,7 +169,7 @@ class ErrorHandler
call_user_func($this->previousExceptionHandler, $e);
}
if (!headers_sent() && ini_get('display_errors') === 0) {
if (!headers_sent() && !ini_get('display_errors')) {
http_response_code(500);
}