function drush_backend_packet_log

8.0.x drush_backend_packet_log($entry, $backend_options)
6.x drush_backend_packet_log($entry, $backend_options)
7.x drush_backend_packet_log($entry, $backend_options)
5.x drush_backend_packet_log($entry, $backend_options)
master drush_backend_packet_log($entry, $backend_options)

Backend command callback. Add a log message to the log history.


entry: The log entry.

Related topics


includes/, line 1328
The drush API implementation and helpers.


function drush_backend_packet_log($entry, $backend_options) {
  if (!$backend_options['log']) {
  if (!is_string($entry['message'])) {
    $entry['message'] = implode("\n", (array) $entry['message']);
  $entry['message'] = $entry['message'];
  if (array_key_exists('#output-label', $backend_options)) {
    $entry['message'] = $backend_options['#output-label'] . $entry['message'];

  // If integrate is FALSE, then log messages are stored in DRUSH_LOG,
  // but are -not- printed to the console.
  if ($backend_options['integrate']) {
  else {
    $log = &drush_get_context('DRUSH_LOG', array());
    $log[] = $entry;
    // Yes, this looks odd, but we might in fact be a backend command
    // that ran another backend command.
    drush_backend_packet('log', $entry);