You are here

public function RealisticDummyContentDrushLog::error in Realistic Dummy Content 3.x

Same name and namespace in other branches
  1. 8.2 api/src/includes/RealisticDummyContentDrushLog.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentDrushLog::error()
  2. 7.2 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 21

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 = []) {
  $this
    ->log('RealisticDummyContent_FAILURE');
  throw new \Exception('RealisticDummyContent_ERROR ' . dt($text, $vars));
}