You are here

public function HttpblLogTrapper::log in http:BL 8

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

Overrides RfcLoggerTrait::log

8 calls to HttpblLogTrapper::log()
HttpblLogTrapper::trapAlert in src/Logger/HttpblLogTrapper.php
Traps and forwards ALERT messages, based on config setting.
HttpblLogTrapper::trapCritical in src/Logger/HttpblLogTrapper.php
Traps and forwards CRITICAL messages, based on config setting.
HttpblLogTrapper::trapDebug in src/Logger/HttpblLogTrapper.php
Traps and forwards DEBUG messages, based on config setting.
HttpblLogTrapper::trapEmergency in src/Logger/HttpblLogTrapper.php
Traps and forwards EMERGENCY messages, based on config setting.
HttpblLogTrapper::trapError in src/Logger/HttpblLogTrapper.php
Traps and forwards ERROR messages, based on config setting.

... See full list

File

src/Logger/HttpblLogTrapper.php, line 148

Class

HttpblLogTrapper
(An arbitrated logger)

Namespace

Drupal\httpbl\Logger

Code

public function log($level, $message, array $context = array()) {

  // Convert PSR3-style messages to SafeMarkup::format() style, so they can be
  // translated too in runtime.
  // @todo No longer using this for the time being.  Remove once certain it is
  // not needed.  Removal includes removing the parsing service from the
  // service container.
  $message_placeholders = $this->parser
    ->parseMessagePlaceholders($message, $context);
  switch ($level) {
    case 7:
      $method = 'debug';
      break;
    case 6:
      $method = 'info';
      break;
    case 5:
      $method = 'notice';
      break;
    case 4:
      $method = 'warning';
      break;
    case 3:
      $method = 'error';
      break;
    case 2:
      $method = 'critical';
      break;
    case 1:
      $method = 'alert';
      break;
    case 0:
      $method = 'emergency';
      break;
  }
  $this->logger
    ->{$method}($message, $context);
}