function system_watchdog

8.0.x drupal.inc system_watchdog($log_entry)
6.x drupal.inc system_watchdog($log_entry)
7.x drupal.inc system_watchdog($log_entry)
3.x drush.inc system_watchdog($log_entry)
4.x drush.inc system_watchdog($log_entry)
5.x drupal.inc system_watchdog($log_entry)
master drupal.inc system_watchdog($log_entry)

Log Drupal watchdog() calls.

A sneaky implementation of hook_watchdog().

Related topics

File

includes/drush.inc, line 1599
The drush API implementation and helpers.

Code

function system_watchdog($log_entry) {

  // Transform non informative severity levels to 'error' for compatibility with _drush_print_log.
  // Other severity levels are coincident with the ones we use in drush.
  if (drush_drupal_major_version() >= 6 && $log_entry['severity'] <= 2) {
    $severity = 'error';
  }
  else {
    drush_include_engine('drupal', 'environment');
    $levels = core_watchdog_severity_levels();
    $severity = $levels[$log_entry['severity']];
  }
  // Format the message.
  if (is_array($log_entry['variables'])) {
    $message = strtr($log_entry['message'], $log_entry['variables']);
  }
  else {
    $message = $log_entry['message'];
  }
  $message = strip_tags(decode_entities($message));
  // Log it.
  drush_log('WD ' . $log_entry['type'] . ': ' . $message, $severity);
}