You are here

interface LoggerServiceInterface in Purge 8.3

Describes logging services to purge and its submodules, via a single channel.

Hierarchy

Expanded class hierarchy of LoggerServiceInterface

All classes that implement LoggerServiceInterface

4 files declare their use of LoggerServiceInterface
DebugCommands.php in modules/purge_drush/src/Commands/DebugCommands.php
LoggingConfigForm.php in modules/purge_ui/src/Form/LoggingConfigForm.php
PurgersService.php in src/Plugin/Purge/Purger/PurgersService.php
QueueService.php in src/Plugin/Purge/Queue/QueueService.php

File

src/Logger/LoggerServiceInterface.php, line 11

Namespace

Drupal\purge\Logger
View source
interface LoggerServiceInterface extends ServiceProviderInterface, ServiceModifierInterface {

  /**
   * Delete a channel part.
   *
   * @param string $id
   *   The identifier of the channel part.
   */
  public function deleteChannel($id);

  /**
   * Delete channel parts of which the ID starts with...
   *
   * @param string $id_starts_with
   *   Prefix to match all channel parts with to delete.
   */
  public function deleteChannels($id_starts_with);

  /**
   * Retrieve a channel part instance.
   *
   * This creates a 'channel part' logger object compliant to the widely used
   * \Psr\Log\LoggerInterface difference, with the difference that messages are
   * funneled through a single channel and severities can be configured. Newly
   * requested IDs will be automatically registered through ::setChannel().
   *
   * @param string $id
   *   The identifier of the channel part.
   *
   * @throws \LogicException
   *   Thrown when the given id is empty or otherwise invalid.
   *
   * @return \Drupal\purge\Logger\LoggerChannelPartInterface
   *   The channel part instance.
   */
  public function get($id);

  /**
   * Retrieve information on all registered channels and their grants.
   *
   * @return array[]
   *   Unassociative array, with associative arrays in them. Each array
   *   represents a single chanenl and has a key 'id' and 'grants', the latter
   *   is another unassociative array with the enabled grants for that channel.
   */
  public function getChannels();

  /**
   * Check whether the given channel is registered.
   *
   * @param string $id
   *   The identifier of the channel part.
   *
   * @return true|false
   *   Whether the given channel is registered or not.
   */
  public function hasChannel($id);

  /**
   * Add or update a channel part and its permissions.
   *
   * @param string $id
   *   The identifier of the channel part.
   * @param 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:
   *    - \Drupal\Core\Logger\RfcLogLevel::EMERGENCY
   *    - \Drupal\Core\Logger\RfcLogLevel::ALERT
   *    - \Drupal\Core\Logger\RfcLogLevel::CRITICAL
   *    - \Drupal\Core\Logger\RfcLogLevel::ERROR
   *    - \Drupal\Core\Logger\RfcLogLevel::WARNING
   *    - \Drupal\Core\Logger\RfcLogLevel::NOTICE
   *    - \Drupal\Core\Logger\RfcLogLevel::INFO
   *    - \Drupal\Core\Logger\RfcLogLevel::DEBUG.
   *
   * @throws \LogicException
   *   Thrown when the given id is empty or otherwise invalid.
   * @throws \LogicException
   *   Thrown when any given grant isn't known or otherwise invalid.
   */
  public function setChannel($id, array $grants = []);

}

Members

Namesort descending Modifiers Type Description Overrides
LoggerServiceInterface::deleteChannel public function Delete a channel part. 1
LoggerServiceInterface::deleteChannels public function Delete channel parts of which the ID starts with... 1
LoggerServiceInterface::get public function Retrieve a channel part instance. 1
LoggerServiceInterface::getChannels public function Retrieve information on all registered channels and their grants. 1
LoggerServiceInterface::hasChannel public function Check whether the given channel is registered. 1
LoggerServiceInterface::setChannel public function Add or update a channel part and its permissions. 1
ServiceModifierInterface::alter public function Modifies existing service definitions. 13
ServiceProviderInterface::register public function Registers services to the container. 14