You are here

public function RealisticDummyContentDrushLog::error 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::error()
  2. 3.x api/src/includes/RealisticDummyContentDrushLog.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentDrushLog::error()

Add a log entry for an error.

Parameters

string $text: Text for the log entry.

array $vars: Variables to insert in the text.

Overrides RealisticDummyContentLogInterface::error

File

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

Class

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

Namespace

Drupal\realistic_dummy_content_api\includes

Code

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);
}