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

Breadcrumb

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

function TestLogger::hasRecord

Parameters

string|array<string, mixed> $record:

File

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

Class

TestLogger
Used for testing purposes.

Namespace

ColinODell\PsrTestLogger

Code

public function hasRecord(string|array $record, string|int|null $level = null) : bool {
    if (\is_string($record)) {
        $record = [
            'message' => $record,
        ];
    }
    return $this->hasRecordThatPasses(static function (array $rec) use ($record) {
        if ((string) $rec['message'] !== (string) $record['message']) {
            return false;
        }
        return !isset($record['context']) || $rec['context'] === $record['context'];
    }, $level);
}

API Navigation

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