Update to Drupal 8.2.0. For more information, see https://www.drupal.org/project/drupal/releases/8.2.0
This commit is contained in:
parent
2f563ab520
commit
f1c8716f57
1732 changed files with 52334 additions and 11780 deletions
|
@ -80,6 +80,7 @@ function _drupal_error_handler_real($error_level, $message, $filename, $line, $c
|
|||
'%line' => $caller['line'],
|
||||
'severity_level' => $severity_level,
|
||||
'backtrace' => $backtrace,
|
||||
'@backtrace_string' => (new \Exception())->getTraceAsString(),
|
||||
), $recoverable || $to_string);
|
||||
}
|
||||
}
|
||||
|
@ -116,9 +117,9 @@ function error_displayable($error = NULL) {
|
|||
*
|
||||
* @param $error
|
||||
* An array with the following keys: %type, @message, %function, %file,
|
||||
* %line, severity_level, and backtrace. All the parameters are plain-text,
|
||||
* with the exception of @message, which needs to be an HTML string, and
|
||||
* backtrace, which is a standard PHP backtrace.
|
||||
* %line, @backtrace_string, severity_level, and backtrace. All the parameters
|
||||
* are plain-text, with the exception of @message, which needs to be an HTML
|
||||
* string, and backtrace, which is a standard PHP backtrace.
|
||||
* @param bool $fatal
|
||||
* TRUE for:
|
||||
* - An exception is thrown and not caught by something else.
|
||||
|
@ -163,18 +164,18 @@ function _drupal_log_error($error, $fatal = FALSE) {
|
|||
// installer.
|
||||
if (\Drupal::hasService('logger.factory')) {
|
||||
try {
|
||||
\Drupal::logger('php')->log($error['severity_level'], '%type: @message in %function (line %line of %file).', $error);
|
||||
\Drupal::logger('php')->log($error['severity_level'], '%type: @message in %function (line %line of %file) @backtrace_string.', $error);
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
// We can't log, for example because the database connection is not
|
||||
// available. At least try to log to PHP error log.
|
||||
error_log(strtr('Failed to log error: %type: @message in %function (line %line of %file).', $error));
|
||||
error_log(strtr('Failed to log error: %type: @message in %function (line %line of %file). @backtrace_string', $error));
|
||||
}
|
||||
}
|
||||
|
||||
// Log fatal errors, so developers can find and debug them.
|
||||
if ($fatal) {
|
||||
error_log(sprintf('%s: %s in %s on line %d', $error['%type'], $error['@message'], $error['%file'], $error['%line']));
|
||||
error_log(sprintf('%s: %s in %s on line %d %s', $error['%type'], $error['@message'], $error['%file'], $error['%line'], $error['@backtrace_string']));
|
||||
}
|
||||
|
||||
if (PHP_SAPI === 'cli') {
|
||||
|
|
Reference in a new issue