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\PsrTestLoggerCode
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);
}