diff --git a/src/SentryLogger.php b/src/SentryLogger.php index e5e8d04..3bee297 100644 --- a/src/SentryLogger.php +++ b/src/SentryLogger.php @@ -29,15 +29,14 @@ public static function register(): void } - /** - * @param mixed $value - * @param string $level - */ - public function log($value, $level = self::INFO): void + public function log(mixed $value, mixed $level = self::INFO): void { $this->fallback->log($value, $level); + if (is_string($level) === false) { + return; + } try { - $this->logToSentry($value, (string) $level); + $this->logToSentry($value, $level); } catch (\Throwable $e) { $this->fallback->log($e, ILogger::CRITICAL); }