= 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 or print or ignore. Just printing saves memory but thats rarely needed. switch (drush_get_option('watchdog', 'log')) { case 'log': drush_log('WD '. $log_entry['type'] . ': ' . $message, $severity); break; case 'print': // Disable in backend mode since it logs output and the goal is to conserve memory. // @see _drush_bootstrap_drush(). if (ob_get_length() === FALSE) { drush_print('WD '. $severity . ' ' . $log_entry['type'] . ': ' . $message); } break; default: // Do nothing. } } /** * Log the return value of Drupal hook_update_n functions. * * This is used during install and update to log the output * of the update process to the logging system. */ function _drush_log_update_sql($ret) { if (sizeof($ret)) { foreach ($ret as $info) { if (is_array($info)) { if (!$info['success']) { drush_set_error('DRUPAL_UPDATE_FAILED', $info['query']); } else { drush_log($info['query'], ($info['success']) ? 'success' : 'error'); } } } } }