You are here

class HttpblLogTrapper in http:BL 8

Same name in this branch
  1. 8 src/Logger/HttpblLogTrapper.php \Drupal\httpbl\Logger\HttpblLogTrapper
  2. 8 src/ProxyClass/Logger/HttpblLogTrapper.php \Drupal\httpbl\ProxyClass\Logger\HttpblLogTrapper

Provides a proxy class for \Drupal\httpbl\Logger\HttpblLogTrapper.

Hierarchy

Expanded class hierarchy of HttpblLogTrapper

See also

\Drupal\Component\ProxyBuilder

File

src/ProxyClass/Logger/HttpblLogTrapper.php, line 20

Namespace

Drupal\httpbl\ProxyClass\Logger
View source
class HttpblLogTrapper implements \Drupal\httpbl\Logger\HttpblLogTrapperInterface {
  use \Drupal\Core\DependencyInjection\DependencySerializationTrait;

  /**
   * The id of the original proxied service.
   *
   * @var string
   */
  protected $drupalProxyOriginalServiceId;

  /**
   * The real proxied service, after it was lazy loaded.
   *
   * @var \Drupal\httpbl\Logger\HttpblLogTrapper
   */
  protected $service;

  /**
   * The service container.
   *
   * @var \Symfony\Component\DependencyInjection\ContainerInterface
   */
  protected $container;

  /**
   * Constructs a ProxyClass Drupal proxy object.
   *
   * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
   *   The container.
   * @param string $drupal_proxy_original_service_id
   *   The service ID of the original service.
   */
  public function __construct(\Symfony\Component\DependencyInjection\ContainerInterface $container, $drupal_proxy_original_service_id) {
    $this->container = $container;
    $this->drupalProxyOriginalServiceId = $drupal_proxy_original_service_id;
  }

  /**
   * Lazy loads the real service from the container.
   *
   * @return object
   *   Returns the constructed real service.
   */
  protected function lazyLoadItself() {
    if (!isset($this->service)) {
      $this->service = $this->container
        ->get($this->drupalProxyOriginalServiceId);
    }
    return $this->service;
  }

  /**
   * {@inheritdoc}
   */
  public function trapEmergency($message, array $context = array(), $logVolume = HTTPBL_LOG_QUIET) {
    return $this
      ->lazyLoadItself()
      ->trapEmergency($message, $context, $logVolume);
  }

  /**
   * {@inheritdoc}
   */
  public function trapAlert($message, array $context = array(), $logVolume = HTTPBL_LOG_QUIET) {
    return $this
      ->lazyLoadItself()
      ->trapAlert($message, $context, $logVolume);
  }

  /**
   * {@inheritdoc}
   */
  public function trapCritical($message, array $context = array(), $logVolume = HTTPBL_LOG_QUIET) {
    return $this
      ->lazyLoadItself()
      ->trapCritical($message, $context, $logVolume);
  }

  /**
   * {@inheritdoc}
   */
  public function trapError($message, array $context = array(), $logVolume = HTTPBL_LOG_QUIET) {
    return $this
      ->lazyLoadItself()
      ->trapError($message, $context, $logVolume);
  }

  /**
   * {@inheritdoc}
   */
  public function trapWarning($message, array $context = array(), $logVolume = HTTPBL_LOG_MIN) {
    return $this
      ->lazyLoadItself()
      ->trapWarning($message, $context, $logVolume);
  }

  /**
   * {@inheritdoc}
   */
  public function trapNotice($message, array $context = array(), $logVolume = HTTPBL_LOG_MIN) {
    return $this
      ->lazyLoadItself()
      ->trapNotice($message, $context, $logVolume);
  }

  /**
   * {@inheritdoc}
   */
  public function trapInfo($message, array $context = array(), $logVolume = HTTPBL_LOG_VERBOSE) {
    return $this
      ->lazyLoadItself()
      ->trapInfo($message, $context, $logVolume);
  }

  /**
   * {@inheritdoc}
   */
  public function trapDebug($message, array $context = array(), $logVolume = HTTPBL_LOG_VERBOSE) {
    return $this
      ->lazyLoadItself()
      ->trapDebug($message, $context, $logVolume);
  }

  /**
   * {@inheritdoc}
   */
  public function log($level, $message, array $context = array()) {
    return $this
      ->lazyLoadItself()
      ->log($level, $message, $context);
  }

  /**
   * {@inheritdoc}
   */
  public function emergency($message, array $context = array()) {
    return $this
      ->lazyLoadItself()
      ->emergency($message, $context);
  }

  /**
   * {@inheritdoc}
   */
  public function alert($message, array $context = array()) {
    return $this
      ->lazyLoadItself()
      ->alert($message, $context);
  }

  /**
   * {@inheritdoc}
   */
  public function critical($message, array $context = array()) {
    return $this
      ->lazyLoadItself()
      ->critical($message, $context);
  }

  /**
   * {@inheritdoc}
   */
  public function error($message, array $context = array()) {
    return $this
      ->lazyLoadItself()
      ->error($message, $context);
  }

  /**
   * {@inheritdoc}
   */
  public function warning($message, array $context = array()) {
    return $this
      ->lazyLoadItself()
      ->warning($message, $context);
  }

  /**
   * {@inheritdoc}
   */
  public function notice($message, array $context = array()) {
    return $this
      ->lazyLoadItself()
      ->notice($message, $context);
  }

  /**
   * {@inheritdoc}
   */
  public function info($message, array $context = array()) {
    return $this
      ->lazyLoadItself()
      ->info($message, $context);
  }

  /**
   * {@inheritdoc}
   */
  public function debug($message, array $context = array()) {
    return $this
      ->lazyLoadItself()
      ->debug($message, $context);
  }

  /**
   * {@inheritdoc}
   */
  public function __sleep() {
    return $this
      ->lazyLoadItself()
      ->__sleep();
  }

  /**
   * {@inheritdoc}
   */
  public function __wakeup() {
    return $this
      ->lazyLoadItself()
      ->__wakeup();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
HttpblLogTrapper::$container protected property The service container.
HttpblLogTrapper::$drupalProxyOriginalServiceId protected property The id of the original proxied service.
HttpblLogTrapper::$service protected property The real proxied service, after it was lazy loaded.
HttpblLogTrapper::alert public function
HttpblLogTrapper::critical public function
HttpblLogTrapper::debug public function
HttpblLogTrapper::emergency public function
HttpblLogTrapper::error public function
HttpblLogTrapper::info public function
HttpblLogTrapper::lazyLoadItself protected function Lazy loads the real service from the container.
HttpblLogTrapper::log public function Overrides HttpblLogTrapperInterface::log
HttpblLogTrapper::notice public function
HttpblLogTrapper::trapAlert public function Traps and forwards ALERT messages, based on config setting. Overrides HttpblLogTrapperInterface::trapAlert
HttpblLogTrapper::trapCritical public function Traps and forwards CRITICAL messages, based on config setting. Overrides HttpblLogTrapperInterface::trapCritical
HttpblLogTrapper::trapDebug public function Traps and forwards DEBUG messages, based on config setting. Overrides HttpblLogTrapperInterface::trapDebug
HttpblLogTrapper::trapEmergency public function Traps and forwards EMERGENCY messages, based on config setting. Overrides HttpblLogTrapperInterface::trapEmergency
HttpblLogTrapper::trapError public function Traps and forwards ERROR messages, based on config setting. Overrides HttpblLogTrapperInterface::trapError
HttpblLogTrapper::trapInfo public function Traps and forwards INFO messages, based on config setting. Overrides HttpblLogTrapperInterface::trapInfo
HttpblLogTrapper::trapNotice public function Traps and forwards NOTICE messages, based on config setting. Overrides HttpblLogTrapperInterface::trapNotice
HttpblLogTrapper::trapWarning public function Traps and forwards WARNING messages, based on config setting. Overrides HttpblLogTrapperInterface::trapWarning
HttpblLogTrapper::warning public function
HttpblLogTrapper::__construct public function Constructs a ProxyClass Drupal proxy object.
HttpblLogTrapper::__sleep public function Overrides DependencySerializationTrait::__sleep
HttpblLogTrapper::__wakeup public function Overrides DependencySerializationTrait::__wakeup