Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TestLogger.php

function TestLogger::log

Parameters

array<array-key, mixed> $context:

File

vendor/colinodell/psr-testlogger/src/TestLogger.php, line 73

Class

TestLogger
Used for testing purposes.

Namespace

ColinODell\PsrTestLogger

Code

public function log($level, $message, array $context = []) : void {
    if (!(\is_string($level) || \is_int($level))) {
        throw new InvalidArgumentException('Unsupported log level. The psr-testlogger library only supports string and integer log levels; passed ' . \print_r($level, true));
    }
    $record = [
        'level' => $level,
        'message' => $message,
        'context' => $context,
    ];
    $this->recordsByLevel[$record['level']][] = $record;
    $this->records[] = $record;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal