Last active
July 3, 2019 15:33
-
-
Save bruno-garcia/72fea0440b020831f4b084666494e79c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modifying root scope | |
Sentry.setTag("a","a"); | |
// Creates a new scope and pushes in the stap, a clone of the previous one. | |
Sentry.pushScope(); | |
// Here we have a tag a with value a | |
Sentry.setTag("a","b"); | |
// Now a has value b | |
// Throw away the current scope (goes back to the previous item in the stack) | |
Sentry.popScope(); | |
// Now tag a has value a | |
// withScope is just a short cut: | |
// Modifying root scope | |
Sentry.setTag("a","a"); | |
Sentry.withScope(s => { | |
// Here we have a tag a with value a | |
s.setTag("a","b"); | |
// Now a has value b | |
}) | |
// Throw away the current scope (goes back to the previous item in the stack) | |
// Now tag a has value a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment