@@ -101,7 +101,7 @@ class ErrorHandler
101
101
private static $ stackedErrorLevels = array ();
102
102
103
103
/**
104
- * Same init value as thrownErrors
104
+ * Same init value as thrownErrors.
105
105
*
106
106
* @deprecated since 2.6, to be removed in 3.0.
107
107
*/
@@ -415,7 +415,7 @@ public function handleError($type, $message, $file, $line, array $context)
415
415
} else {
416
416
try {
417
417
$ this ->isRecursive = true ;
418
- $ this ->loggers [$ type ][0 ]->log ($ this ->loggers [$ type ][1 ], $ message , $ e );
418
+ $ this ->loggers [$ type ][0 ]->log (( $ type & $ level ) ? $ this ->loggers [$ type ][1 ] : LogLevel:: DEBUG , $ message , $ e );
419
419
$ this ->isRecursive = false ;
420
420
} catch (\Exception $ e ) {
421
421
$ this ->isRecursive = false ;
@@ -437,13 +437,12 @@ public function handleError($type, $message, $file, $line, array $context)
437
437
*/
438
438
public function handleException (\Exception $ exception , array $ error = null )
439
439
{
440
- $ level = error_reporting ();
441
- if ($ this ->loggedErrors & E_ERROR & ($ level | $ this ->screamedErrors )) {
440
+ if ($ this ->loggedErrors & E_ERROR ) {
442
441
$ e = array (
443
442
'type ' => E_ERROR ,
444
443
'file ' => $ exception ->getFile (),
445
444
'line ' => $ exception ->getLine (),
446
- 'level ' => $ level ,
445
+ 'level ' => error_reporting () ,
447
446
'stack ' => $ exception ->getTrace (),
448
447
);
449
448
if ($ exception instanceof FatalErrorException) {
@@ -547,7 +546,7 @@ public static function stackErrors()
547
546
}
548
547
549
548
/**
550
- * Unstacks stacked errors and forwards to the logger
549
+ * Unstacks stacked errors and forwards to the logger.
551
550
*/
552
551
public static function unstackErrors ()
553
552
{
@@ -666,7 +665,7 @@ public function handleFatal()
666
665
}
667
666
668
667
/**
669
- * Private class used to work around https://bugs.php.net/54275
668
+ * Private class used to work around https://bugs.php.net/54275.
670
669
*
671
670
* @author Nicolas Grekas <p@tchwork.com>
672
671
*
0 commit comments