You are here

class Logger in Zircon Profile 8

Same name in this branch
  1. 8 vendor/wikimedia/composer-merge-plugin/src/Logger.php \Wikimedia\Composer\Logger
  2. 8 vendor/symfony/http-kernel/Tests/Logger.php \Symfony\Component\HttpKernel\Tests\Logger
Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Tests/Logger.php \Symfony\Component\HttpKernel\Tests\Logger

Hierarchy

Expanded class hierarchy of Logger

1 file declares its use of Logger
ExceptionListenerTest.php in vendor/symfony/http-kernel/Tests/EventListener/ExceptionListenerTest.php

File

vendor/symfony/http-kernel/Tests/Logger.php, line 16

Namespace

Symfony\Component\HttpKernel\Tests
View source
class Logger implements LoggerInterface {
  protected $logs;
  public function __construct() {
    $this
      ->clear();
  }
  public function getLogs($level = false) {
    return false === $level ? $this->logs : $this->logs[$level];
  }
  public function clear() {
    $this->logs = array(
      'emergency' => array(),
      'alert' => array(),
      'critical' => array(),
      'error' => array(),
      'warning' => array(),
      'notice' => array(),
      'info' => array(),
      'debug' => array(),
    );
  }
  public function log($level, $message, array $context = array()) {
    $this->logs[$level][] = $message;
  }
  public function emergency($message, array $context = array()) {
    $this
      ->log('emergency', $message, $context);
  }
  public function alert($message, array $context = array()) {
    $this
      ->log('alert', $message, $context);
  }
  public function critical($message, array $context = array()) {
    $this
      ->log('critical', $message, $context);
  }
  public function error($message, array $context = array()) {
    $this
      ->log('error', $message, $context);
  }
  public function warning($message, array $context = array()) {
    $this
      ->log('warning', $message, $context);
  }
  public function notice($message, array $context = array()) {
    $this
      ->log('notice', $message, $context);
  }
  public function info($message, array $context = array()) {
    $this
      ->log('info', $message, $context);
  }
  public function debug($message, array $context = array()) {
    $this
      ->log('debug', $message, $context);
  }

  /**
   * @deprecated
   */
  public function emerg($message, array $context = array()) {
    @trigger_error('Use emergency() which is PSR-3 compatible', E_USER_DEPRECATED);
    $this
      ->log('emergency', $message, $context);
  }

  /**
   * @deprecated
   */
  public function crit($message, array $context = array()) {
    @trigger_error('Use critical() which is PSR-3 compatible', E_USER_DEPRECATED);
    $this
      ->log('critical', $message, $context);
  }

  /**
   * @deprecated
   */
  public function err($message, array $context = array()) {
    @trigger_error('Use error() which is PSR-3 compatible', E_USER_DEPRECATED);
    $this
      ->log('error', $message, $context);
  }

  /**
   * @deprecated
   */
  public function warn($message, array $context = array()) {
    @trigger_error('Use warning() which is PSR-3 compatible', E_USER_DEPRECATED);
    $this
      ->log('warning', $message, $context);
  }

}

Members

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