-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added custom options configuration to samples (#568)
* added CustomOptionsConfiguration sample * updated snapshot * added additional comment * updated CHANGELOG.md * Update samples/unity-of-bugs/Assets/Scripts/CustomOptionsConfiguration.cs Co-authored-by: Bruno Garcia <bruno@brunogarcia.com> * Update samples/unity-of-bugs/Assets/Scripts/CustomOptionsConfiguration.cs Co-authored-by: Bruno Garcia <bruno@brunogarcia.com> Co-authored-by: Bruno Garcia <bruno@brunogarcia.com>
- Loading branch information
1 parent
de29836
commit fce257a
Showing
4 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
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
25 changes: 25 additions & 0 deletions
25
samples/unity-of-bugs/Assets/Scripts/CustomOptionsConfiguration.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using Sentry.Unity; | ||
using UnityEngine; | ||
|
||
[CreateAssetMenu(fileName = "Assets/Resources/Sentry/CustomOptionsConfiguration", menuName = "Sentry/CustomOptionsConfiguration", order = 999)] | ||
public class CustomOptionsConfiguration : ScriptableOptionsConfiguration | ||
{ | ||
// This method gets called when you instantiated the scriptable object and added it to the configuration window | ||
public override void Configure(SentryUnityOptions options) | ||
{ | ||
// NOTE: Changes to the options object done here will not affect native crashes. The native SDKs only take | ||
// options defined in the Sentry editor configuration window. | ||
// Learn more at: https://docs.sentry.io/platforms/unity/native-support/configuration/ | ||
|
||
options.BeforeSend = sentryEvent => | ||
{ | ||
if (sentryEvent.Tags.ContainsKey("SomeTag")) | ||
{ | ||
// Don't send events with a tag SomeTag to Sentry | ||
return null; | ||
} | ||
return sentryEvent; | ||
}; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
samples/unity-of-bugs/Assets/Scripts/CustomOptionsConfiguration.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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