You are here

class NaughtyRecursiveLogger in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php \Drupal\Tests\Core\Logger\NaughtyRecursiveLogger

Hierarchy

  • class \Drupal\Tests\Core\Logger\NaughtyRecursiveLogger implements \Psr\Log\LoggerInterface uses \Psr\Log\LoggerTrait

Expanded class hierarchy of NaughtyRecursiveLogger

File

core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php, line 152
Contains \Drupal\Tests\Core\Logger\LoggerChannelTest.

Namespace

Drupal\Tests\Core\Logger
View source
class NaughtyRecursiveLogger implements LoggerInterface {
  use LoggerTrait;
  protected $channel;
  protected $message;
  public function __construct(LoggerChannel $channel) {
    $this->channel = $channel;
  }
  public function log($level, $message, array $context = []) {
    $this->channel
      ->log(rand(0, 7), $message, $context);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
NaughtyRecursiveLogger::$channel protected property
NaughtyRecursiveLogger::$message protected property
NaughtyRecursiveLogger::log public function Logs with an arbitrary level.
NaughtyRecursiveLogger::__construct public function