You are here

public function LoggerChannelPart::__construct in Purge 8.3

Construct \Drupal\purge\Logger\LoggerChannelPartInterface.

Parameters

\Psr\Log\LoggerInterface $logger_channel_purge: The single and central logger channel used by purge module(s).

string $id: The identifier of the channel part.

int[] $grants: Unassociative array of RFC 5424 log types. Each passed type grants the channel permission to log that type of message, without specific permissions the logger will stay silent for that type.

Grants available:

Overrides LoggerChannelPartInterface::__construct

File

src/Logger/LoggerChannelPart.php, line 57

Class

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

Namespace

Drupal\purge\Logger

Code

public function __construct(LoggerInterface $logger_channel_purge, $id, array $grants = []) {
  $this->id = $id;
  $this->grants = $grants;
  $this->loggerChannelPurge = $logger_channel_purge;
  foreach ($grants as $grant) {
    $this->access[$grant] = TRUE;
  }
}