Skip to content

Commit

Permalink
[Debug] Scream as LogLevel::DEBUG (but for fatal errors / uncaught ex…
Browse files Browse the repository at this point in the history
…ceptions)
  • Loading branch information
nicolas-grekas committed Apr 15, 2015
1 parent 85a494c commit 3450122
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/Symfony/Component/Debug/ErrorHandler.php
Expand Up @@ -101,7 +101,7 @@ class ErrorHandler
private static $stackedErrorLevels = array();

/**
* Same init value as thrownErrors
* Same init value as thrownErrors.
*
* @deprecated since 2.6, to be removed in 3.0.
*/
Expand Down Expand Up @@ -415,7 +415,7 @@ public function handleError($type, $message, $file, $line, array $context)
} else {
try {
$this->isRecursive = true;
$this->loggers[$type][0]->log($this->loggers[$type][1], $message, $e);
$this->loggers[$type][0]->log(($type & $level) ? $this->loggers[$type][1] : LogLevel::DEBUG, $message, $e);
$this->isRecursive = false;
} catch (\Exception $e) {
$this->isRecursive = false;
Expand All @@ -437,13 +437,12 @@ public function handleError($type, $message, $file, $line, array $context)
*/
public function handleException(\Exception $exception, array $error = null)
{
$level = error_reporting();
if ($this->loggedErrors & E_ERROR & ($level | $this->screamedErrors)) {
if ($this->loggedErrors & E_ERROR) {
$e = array(
'type' => E_ERROR,
'file' => $exception->getFile(),
'line' => $exception->getLine(),
'level' => $level,
'level' => error_reporting(),
'stack' => $exception->getTrace(),
);
if ($exception instanceof FatalErrorException) {
Expand Down Expand Up @@ -547,7 +546,7 @@ public static function stackErrors()
}

/**
* Unstacks stacked errors and forwards to the logger
* Unstacks stacked errors and forwards to the logger.
*/
public static function unstackErrors()
{
Expand Down Expand Up @@ -666,7 +665,7 @@ public function handleFatal()
}

/**
* Private class used to work around https://bugs.php.net/54275
* Private class used to work around https://bugs.php.net/54275.
*
* @author Nicolas Grekas <p@tchwork.com>
*
Expand Down

0 comments on commit 3450122

Please sign in to comment.