You are here

private function SpecFetcher::log in Apigee API Catalog 8

Same name and namespace in other branches
  1. 8.2 src/SpecFetcher.php \Drupal\apigee_api_catalog\SpecFetcher::log()

Log a message, and optionally display it on the UI.

Parameters

string $level: The Error level.

string $message: The message.

array $params: Optional parameters array.

1 call to SpecFetcher::log()
SpecFetcher::fetchSpec in src/SpecFetcher.php
Fetch OpenAPI specification file from URL.

File

src/SpecFetcher.php, line 206

Class

SpecFetcher
Class SpecFetcher.

Namespace

Drupal\apigee_api_catalog

Code

private function log(string $level, string $message, array $params = []) {
  $this->logger
    ->log($level, $message, $params);

  // Show the message.
  $this
    ->messenger()
    ->addMessage($this
    ->t($message, $params), static::LOG_LEVEL_MAP[$level] ?? MessengerInterface::TYPE_ERROR);
}