You are here

abstract class LoggerBase in Service Container 7.2

Same name and namespace in other branches
  1. 7 src/Logger/LoggerBase.php \Drupal\service_container\Logger\LoggerBase

Provides a common base class for loggers to reduce boilerplate code.

Hierarchy

Expanded class hierarchy of LoggerBase

File

src/Logger/LoggerBase.php, line 16
Contains \Drupal\service_container\Logger\LoggerBase.

Namespace

Drupal\service_container\Logger
View source
abstract class LoggerBase implements LoggerInterface {

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

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

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

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

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

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

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

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

}

Members

Namesort descending Modifiers Type Description Overrides
LoggerBase::alert public function Action must be taken immediately. Overrides LoggerInterface::alert
LoggerBase::critical public function Critical conditions. Overrides LoggerInterface::critical
LoggerBase::debug public function Detailed debug information. Overrides LoggerInterface::debug
LoggerBase::emergency public function System is unusable. Overrides LoggerInterface::emergency
LoggerBase::error public function Runtime errors that do not require immediate action but should typically be logged and monitored. Overrides LoggerInterface::error
LoggerBase::info public function Interesting events. Overrides LoggerInterface::info
LoggerBase::notice public function Normal but significant events. Overrides LoggerInterface::notice
LoggerBase::warning public function Exceptional occurrences that are not errors. Overrides LoggerInterface::warning
LoggerInterface::log public function Logs with an arbitrary level. 3