You are here

function views_watchdog_get_severity in Views Watchdog 6

Helper functions.

11 calls to views_watchdog_get_severity()
template_preprocess_views_view_watchdog_table in views/theme/theme.inc
Display a view as a table style.
views_handler_field_watchdog_severity::options_form in views/handlers/views_handler_field_watchdog_severity.inc
views_handler_field_watchdog_severity::options_validate in views/handlers/views_handler_field_watchdog_severity.inc
views_handler_field_watchdog_severity::option_definition in views/handlers/views_handler_field_watchdog_severity.inc
views_handler_field_watchdog_severity::render in views/handlers/views_handler_field_watchdog_severity.inc

... See full list

File

./views_watchdog.module, line 27
Allows users to create customized lists and queries from watchdog entries.

Code

function views_watchdog_get_severity($code = NULL, $item = NULL) {
  static $severity = array();
  if (!$severity) {
    $severity[WATCHDOG_EMERG] = array(
      'title' => t('Emergency'),
      'text' => t('System is unusable.'),
      'icon' => 'misc/watchdog-error.png',
      'class' => 'dblog-emerg',
      'arg' => 'emerg',
    );
    $severity[WATCHDOG_ALERT] = array(
      'title' => t('Alert'),
      'text' => t('Action must be taken immediately.'),
      'icon' => 'misc/watchdog-error.png',
      'class' => 'dblog-alert',
      'arg' => 'alert',
    );
    $severity[WATCHDOG_CRITICAL] = array(
      'title' => t('Critical'),
      'text' => t('Critical conditions.'),
      'icon' => 'misc/watchdog-error.png',
      'class' => 'dblog-critical',
      'arg' => 'critical',
    );
    $severity[WATCHDOG_ERROR] = array(
      'title' => t('Error'),
      'text' => t('Error conditions.'),
      'icon' => 'misc/watchdog-error.png',
      'class' => 'dblog-error',
      'arg' => 'error',
    );
    $severity[WATCHDOG_WARNING] = array(
      'title' => t('Warning'),
      'text' => t('Warning conditions.'),
      'icon' => 'misc/watchdog-warning.png',
      'class' => 'dblog-warning',
      'arg' => 'warning',
    );
    $severity[WATCHDOG_NOTICE] = array(
      'title' => t('Notice'),
      'text' => t('Normal but significant condition.'),
      'icon' => '',
      'class' => 'dblog-notice',
      'arg' => 'notice',
    );
    $severity[WATCHDOG_INFO] = array(
      'title' => t('Info'),
      'text' => t('Informational messages.'),
      'icon' => '',
      'class' => 'dblog-info',
      'arg' => 'info',
    );
    $severity[WATCHDOG_DEBUG] = array(
      'title' => t('Debug'),
      'text' => t('Debug-level messages.'),
      'icon' => '',
      'class' => 'dblog-debug',
      'arg' => 'debug',
    );
  }
  return $code ? $item ? $severity[$code][$item] : $severity[$code] : $severity;
}