function _drupal_get_error_level

Returns the current error level.

This function should only be used to get the current error level pre DRUPAL_BOOTSTRAP_KERNEL or before Drupal is installed. In all other situations the following code is preferred:

Drupal::config('system.logging')
  ->get('error_level');

Return value

string The current error level.

2 calls to _drupal_get_error_level()
error_displayable in drupal/core/includes/errors.inc
Determines whether an error should be displayed.
_drupal_log_error in drupal/core/includes/errors.inc
Logs a PHP error or exception and displays an error page in fatal cases.

File

drupal/core/includes/errors.inc, line 304
Functions for error handling.

Code

function _drupal_get_error_level() {
  try {
    return Drupal::config('system.logging')
      ->get('error_level');
  } catch (Exception $e) {

    // During very early install the cache_config table does not exist.
    return ERROR_REPORTING_DISPLAY_ALL;
  }
}