function drush_core_watchdog_list

8.0.x watchdog.drush.inc drush_core_watchdog_list()
6.x watchdog.drush.inc drush_core_watchdog_list()
7.x watchdog.drush.inc drush_core_watchdog_list()
3.x watchdog.drush.inc drush_core_watchdog_list()
4.x watchdog.drush.inc drush_core_watchdog_list()
5.x watchdog.drush.inc drush_core_watchdog_list()
master watchdog.drush.inc drush_core_watchdog_list()

Command callback.

File

commands/core/watchdog.drush.inc, line 90

Code

function drush_core_watchdog_list() {
  $options['-- types --'] = dt('== message types ==');
  $types = core_watchdog_message_types();
  foreach ($types as $type) {
    $options[] = $type;
  }
  $options['-- levels --'] = dt('== severity levels ==');
  drush_include_engine('drupal', 'environment');
  $severities = core_watchdog_severity_levels();
  foreach ($severities as $key => $value) {
    $options[] = "$value($key)";
  }
  $option = drush_choice($options, dt('Select a message type or severity level.'));
  if ($option === FALSE) {
    return drush_user_abort();
  }
  $ntypes = count($types);
  if ($option < $ntypes) {
    drush_set_option('type', $types[$option]);
  }
  else {
    drush_set_option('severity', $option - $ntypes);
  }
  return drush_core_watchdog_show_many();
}