8000 [Debug] Scream as LogLevel::DEBUG (but for fatal errors / uncaught exceptions) by nicolas-grekas · Pull Request #14362 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Debug] Scream as LogLevel::DEBUG (but for fatal errors / uncaught exceptions) #14362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/Symfony/Component/Debug/ErrorHandler.php
8000
Original file line number Diff line number Diff line change
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