Skip to content

Commit

Permalink
Fix wrong parameter name for PsrLogAdapter::log
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Nov 23, 2023
1 parent d115bf4 commit 8e49c21
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/PsrLogAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,21 @@ public static function addLogger(LoggerInterface $logger): void
*
* @see LogSubscriber::log()
*/
public function log(int $mongocLevel, string $domain, string $message): void
public function log(int $level, string $domain, string $message): void
{
if (! isset(self::MONGOC_TO_PSR[$mongocLevel])) {
if (! isset(self::MONGOC_TO_PSR[$level])) {
throw new UnexpectedValueException(sprintf(
'Expected level to be >= %d and <= %d, %d given for domain "%s" and message: %s',
LogSubscriber::LEVEL_ERROR,
LogSubscriber::LEVEL_DEBUG,
$mongocLevel,
$level,
$domain,
$message,
));
}

$instance = self::getInstance();
$psrLevel = self::MONGOC_TO_PSR[$mongocLevel];
$psrLevel = self::MONGOC_TO_PSR[$level];
$context = ['domain' => $domain];

foreach ($instance->loggers as $logger) {
Expand Down

0 comments on commit 8e49c21

Please sign in to comment.