You are here

public function TestLogger::hasRecord in Lockr 7.3

File

vendor/psr/log/Psr/Log/Test/TestLogger.php, line 86

Class

TestLogger
Used for testing purposes.

Namespace

Psr\Log\Test

Code

public function hasRecord($record, $level) {
  if (is_string($record)) {
    $record = [
      'message' => $record,
    ];
  }
  return $this
    ->hasRecordThatPasses(function ($rec) use ($record) {
    if ($rec['message'] !== $record['message']) {
      return false;
    }
    if (isset($record['context']) && $rec['context'] !== $record['context']) {
      return false;
    }
    return true;
  }, $level);
}