function _drush_log

8.0.x drush.inc _drush_log($entry)
7.x drush.inc _drush_log($entry)
master drush.inc _drush_log($entry)

Call the default logger, or the user's log callback, as appropriate.

Related topics

2 calls to _drush_log()
drush_backend_packet_log in includes/drush.inc
Backend command callback. Add a log message to the log history.
drush_log in includes/drush.inc
Add a log message to the log history.

File

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

Code

function _drush_log($entry) {
  $callback = drush_get_context('DRUSH_LOG_CALLBACK');
  if (!$callback) {
    $callback = \Drush::logger();
  }
  if ($callback instanceof LoggerInterface) {
    _drush_log_to_logger($callback, $entry);
  }
  elseif ($callback) {
    $log = &drush_get_context('DRUSH_LOG', array());
    $log[] = $entry;
    drush_backend_packet('log', $entry);
    return $callback($entry);
  }
}