diff --git a/core/includes/errors.inc b/core/includes/errors.inc index ca63715..28a8cbe 100644 --- a/core/includes/errors.inc +++ b/core/includes/errors.inc @@ -203,31 +203,33 @@ function _drupal_log_error($error, $fatal = FALSE) { // Attempt to reduce verbosity by removing DRUPAL_ROOT from the file path // in the message. This does not happen for (false) security. if (\Drupal::hasService('app.root')) { $root_length = strlen(\Drupal::root()); if (substr($error['%file'], 0, $root_length) == \Drupal::root()) { $error['%file'] = substr($error['%file'], $root_length + 1); } } // Check if verbose error reporting is on. $error_level = _drupal_get_error_level(); - // We call SafeMarkup::format() directly here, rather than use t() since - // we are in the middle of error handling, and we don't want t() to - // cause further errors. - $message = SafeMarkup::format('%type: @message in %function (line %line of %file).', $error); + if ($error_level != ERROR_REPORTING_DISPLAY_VERBOSE) { + // We call SafeMarkup::format() directly here, rather than use t() since + // we are in the middle of error handling, and we don't want t() to + // cause further errors. + $message = SafeMarkup::format('%type: @message in %function (line %line of %file).', $error); + } + else { + // With verbose logging, we will append a backtrace. - // With verbose logging, we will append a backtrace. - if ($error_level == ERROR_REPORTING_DISPLAY_VERBOSE) { // First trace is the error itself, already contained in the message. // While the second trace is the error source and also contained in the // message, the message doesn't contain argument values, so we output it // once more in the backtrace. array_shift($backtrace); // Generate a backtrace containing only scalar argument values. $error['@backtrace'] = Error::formatBacktrace($backtrace); $message = SafeMarkup::format('%type: @message in %function (line %line of %file).
@backtrace
', $error); } } if ($fatal) {