You are here

class RealisticDummyContentDrushLog in Realistic Dummy Content 8.2

Same name and namespace in other branches
  1. 7.2 api/src/includes/RealisticDummyContentDrushLog.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentDrushLog
  2. 3.x api/src/includes/RealisticDummyContentDrushLog.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentDrushLog

The Drush log, allows function to log messages to Drush.

Hierarchy

Expanded class hierarchy of RealisticDummyContentDrushLog

1 file declares its use of RealisticDummyContentDrushLog
realistic_dummy_content_api.drush.inc in api/realistic_dummy_content_api.drush.inc
Drush integration for the realistic_dummy_content_api module.

File

api/src/includes/RealisticDummyContentDrushLog.php, line 8

Namespace

Drupal\realistic_dummy_content_api\includes
View source
class RealisticDummyContentDrushLog implements RealisticDummyContentLogInterface {

  /**
   * {@inheritdoc}
   */
  public function log($text, $vars = array()) {
    drush_log(dt($text, $vars), 'ok');
  }

  /**
   * {@inheritdoc}
   */
  public function error($text, $vars = array()) {
    $this
      ->log('RealisticDummyContent_FAILURE');
    drush_set_error('RealisticDummyContent_ERROR', dt($text, $vars));
    drush_set_context('DRUSH_ERROR_CODE', 1);

    // We need this for jenkins to get 1 to show up in $? With drush_die(1).
    // $? returns 0 in the command line.
    die(1);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RealisticDummyContentDrushLog::error public function Add a log entry for an error. Overrides RealisticDummyContentLogInterface::error
RealisticDummyContentDrushLog::log public function Add a log entry for normal execution. Overrides RealisticDummyContentLogInterface::log