Set the Level

The level - similar to logging levels - is generally added by default based on the integration. You can also override it within an event.

Copied
\Sentry\withScope(function (\Sentry\State\Scope $scope): void {
    $scope->setLevel(\Sentry\Severity::warning());

    \Sentry\captureMessage('This is now a warning!');
});