Skip to content

Commit

Permalink
fix(contrib-auto-laravel): fix log level is string but underlying log…
Browse files Browse the repository at this point in the history
…ger expects int leading to incorrect types
  • Loading branch information
flc1125 committed Oct 16, 2024
1 parent c28ea77 commit 7a48cd9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Instrumentation/Laravel/src/Watchers/LogWatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ public function recordLog(MessageLogged $log): void
$underlyingLogger = $this->logger->getLogger();

/** @phan-suppress-next-line PhanUndeclaredMethod */
if (method_exists($underlyingLogger, 'isHandling') && !$underlyingLogger->isHandling(
$underlyingLogger->toMonologLevel($log->level))
if (method_exists($underlyingLogger, 'isHandling')
&& method_exists($underlyingLogger, 'toMonologLevel')
&& !$underlyingLogger->isHandling($underlyingLogger->toMonologLevel($log->level))
) {
return;
}
Expand Down

0 comments on commit 7a48cd9

Please sign in to comment.