You are here

public function LoggerMock::log in Acquia Content Hub 8.2

Overrides RfcLoggerTrait::log

File

tests/src/Unit/Helpers/LoggerMock.php, line 42

Class

LoggerMock
Mock Logger created for easy assertions of log messages.

Namespace

Drupal\Tests\acquia_contenthub\Unit\Helpers

Code

public function log($level, $message, array $context = []) {
  if (!empty($context)) {
    $message_placeholders = $this->parser
      ->parseMessagePlaceholders($message, $context);
    $message = empty($message_placeholders) ? $message : strtr($message, $message_placeholders);
  }
  $this->logMessages[$level][] = strip_tags($message);
}