You are here

public function LoggerChannelPart::log in Purge 8.3

Prefixes messages with the channel ID so that the origin can be traced.

Overrides LoggerChannelPartInterface::log

8 calls to LoggerChannelPart::log()
LoggerChannelPart::alert in src/Logger/LoggerChannelPart.php
Logs only when granted \Drupal\Core\Logger\RfcLogLevel::EMERGENCY.
LoggerChannelPart::critical in src/Logger/LoggerChannelPart.php
Logs only when granted \Drupal\Core\Logger\RfcLogLevel::CRITICAL.
LoggerChannelPart::debug in src/Logger/LoggerChannelPart.php
Logs only when granted \Drupal\Core\Logger\RfcLogLevel::DEBUG.
LoggerChannelPart::emergency in src/Logger/LoggerChannelPart.php
Logs only when granted \Drupal\Core\Logger\RfcLogLevel::EMERGENCY.
LoggerChannelPart::error in src/Logger/LoggerChannelPart.php
Logs only when granted \Drupal\Core\Logger\RfcLogLevel::ERROR.

... See full list

File

src/Logger/LoggerChannelPart.php, line 155

Class

LoggerChannelPart
Provides a subchannel whichs logs to a single main channel with permissions.

Namespace

Drupal\purge\Logger

Code

public function log($level, $message, array $context = []) {
  $context += [
    '@purge_channel_part' => $this->id,
  ];
  $message = '@purge_channel_part: ' . $message;
  $this->loggerChannelPurge
    ->log($level, $message, $context);
}