You are here

class RealisticDummyContentDrushLog 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
  2. 7.2 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

2 files declare their use of RealisticDummyContentDrushLog
RealisticDummyContentDrushCommands.php in api/src/DrushCommands/RealisticDummyContentDrushCommands.php
realistic_dummy_content_api.drush.inc in api/realistic_dummy_content_api.drush.inc
Drush < 9 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 = []) {

    // @phpstan-ignore-next-line
    \Drupal::logger("realistic_dummy_content_api")
      ->notice(dt($text, $vars));
  }

  /**
   * {@inheritdoc}
   */
  public function error($text, $vars = []) {
    $this
      ->log('RealisticDummyContent_FAILURE');
    throw new \Exception('RealisticDummyContent_ERROR ' . dt($text, $vars));
  }

}

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