We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
use_scope
1 parent a03108f commit 406c68dCopy full SHA for 406c68d
sentry_sdk/scope.py
@@ -1514,12 +1514,14 @@ def use_scope(scope):
1514
After the wrapped code is executed, the original scope is restored.
1515
1516
Example Usage:
1517
+ Suppose the variable `scope` contains a `Scope` object, which is not currently
1518
+ the active scope.
1519
1520
.. code-block:: python
1521
1522
import sentry_sdk
1523
- with sentry_sdk.new_scope() as scope:
1524
+ with sentry_sdk.use_scope(scope):
1525
scope.set_tag("color", "green")
1526
sentry_sdk.capture_message("hello") # will include `color` tag.
1527
0 commit comments