You are here

function drupal_error_levels in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/includes/errors.inc \drupal_error_levels()

Maps PHP error constants to watchdog severity levels.

The error constants are documented at http://php.net/manual/errorfunc.constants.php

Related topics

1 call to drupal_error_levels()
_drupal_error_handler_real in core/includes/errors.inc
Provides custom PHP error handling.

File

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

Code

function drupal_error_levels() {
  $types = array(
    E_ERROR => array(
      'Error',
      RfcLogLevel::ERROR,
    ),
    E_WARNING => array(
      'Warning',
      RfcLogLevel::WARNING,
    ),
    E_PARSE => array(
      'Parse error',
      RfcLogLevel::ERROR,
    ),
    E_NOTICE => array(
      'Notice',
      RfcLogLevel::NOTICE,
    ),
    E_CORE_ERROR => array(
      'Core error',
      RfcLogLevel::ERROR,
    ),
    E_CORE_WARNING => array(
      'Core warning',
      RfcLogLevel::WARNING,
    ),
    E_COMPILE_ERROR => array(
      'Compile error',
      RfcLogLevel::ERROR,
    ),
    E_COMPILE_WARNING => array(
      'Compile warning',
      RfcLogLevel::WARNING,
    ),
    E_USER_ERROR => array(
      'User error',
      RfcLogLevel::ERROR,
    ),
    E_USER_WARNING => array(
      'User warning',
      RfcLogLevel::WARNING,
    ),
    E_USER_NOTICE => array(
      'User notice',
      RfcLogLevel::NOTICE,
    ),
    E_STRICT => array(
      'Strict warning',
      RfcLogLevel::DEBUG,
    ),
    E_RECOVERABLE_ERROR => array(
      'Recoverable fatal error',
      RfcLogLevel::ERROR,
    ),
    E_DEPRECATED => array(
      'Deprecated function',
      RfcLogLevel::DEBUG,
    ),
    E_USER_DEPRECATED => array(
      'User deprecated function',
      RfcLogLevel::DEBUG,
    ),
  );
  return $types;
}