-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4feaa5
commit 3c6d1a0
Showing
26 changed files
with
368 additions
and
296 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
14 changes: 0 additions & 14 deletions
14
samples/unity-of-bugs/Assets/Resources/Sentry/BuildTimeOptionsConfiguration.asset
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
samples/unity-of-bugs/Assets/Resources/Sentry/RuntimeOptionsConfiguration.asset.meta
This file was deleted.
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
2 changes: 1 addition & 1 deletion
2
.../BuildTimeOptionsConfiguration.asset.meta → ...ntry/SentryOptionConfiguration.asset.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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,25 +13,25 @@ MonoBehaviour: | |
m_Name: SentryOptions | ||
m_EditorClassIdentifier: | ||
<Enabled>k__BackingField: 1 | ||
<Dsn>k__BackingField: https://[email protected]/4504604988538880 | ||
<Dsn>k__BackingField: https://[email protected].us.sentry.io/4504604988538880 | ||
<CaptureInEditor>k__BackingField: 1 | ||
<EnableLogDebouncing>k__BackingField: 0 | ||
<DebounceTimeLog>k__BackingField: 1000 | ||
<DebounceTimeWarning>k__BackingField: 1000 | ||
<DebounceTimeError>k__BackingField: 1000 | ||
<TracesSampleRate>k__BackingField: 1 | ||
<TracesSampleRate>k__BackingField: 0 | ||
<AutoStartupTraces>k__BackingField: 1 | ||
<AutoSceneLoadTraces>k__BackingField: 1 | ||
<AutoAwakeTraces>k__BackingField: 1 | ||
<AutoAwakeTraces>k__BackingField: 0 | ||
<AutoSessionTracking>k__BackingField: 1 | ||
<AutoSessionTrackingInterval>k__BackingField: 30000 | ||
<ReleaseOverride>k__BackingField: | ||
<EnvironmentOverride>k__BackingField: | ||
<AttachStacktrace>k__BackingField: 0 | ||
<AttachScreenshot>k__BackingField: 1 | ||
<ScreenshotQuality>k__BackingField: 2 | ||
<AttachScreenshot>k__BackingField: 0 | ||
<ScreenshotQuality>k__BackingField: 1 | ||
<ScreenshotCompression>k__BackingField: 75 | ||
<AttachViewHierarchy>k__BackingField: 1 | ||
<AttachViewHierarchy>k__BackingField: 0 | ||
<MaxViewHierarchyRootObjects>k__BackingField: 100 | ||
<MaxViewHierarchyObjectChildCount>k__BackingField: 20 | ||
<MaxViewHierarchyDepth>k__BackingField: 10 | ||
|
@@ -46,25 +46,30 @@ MonoBehaviour: | |
<IsEnvironmentUser>k__BackingField: 0 | ||
<EnableOfflineCaching>k__BackingField: 1 | ||
<MaxCacheItems>k__BackingField: 30 | ||
<InitCacheFlushTimeout>k__BackingField: 2000 | ||
<InitCacheFlushTimeout>k__BackingField: 0 | ||
<SampleRate>k__BackingField: 1 | ||
<ShutdownTimeout>k__BackingField: 2000 | ||
<MaxQueueItems>k__BackingField: 30 | ||
<AnrDetectionEnabled>k__BackingField: 1 | ||
<AnrTimeout>k__BackingField: 5000 | ||
<CaptureFailedRequests>k__BackingField: 1 | ||
<FailedRequestStatusCodes>k__BackingField: f401000057020000 | ||
<FilterBadGatewayExceptions>k__BackingField: 1 | ||
<FilterWebExceptions>k__BackingField: 1 | ||
<FilterSocketExceptions>k__BackingField: 1 | ||
<IosNativeSupportEnabled>k__BackingField: 1 | ||
<AndroidNativeSupportEnabled>k__BackingField: 1 | ||
<NdkIntegrationEnabled>k__BackingField: 1 | ||
<NdkScopeSyncEnabled>k__BackingField: 1 | ||
<PostGenerateGradleProjectCallbackOrder>k__BackingField: 1 | ||
<WindowsNativeSupportEnabled>k__BackingField: 1 | ||
<MacosNativeSupportEnabled>k__BackingField: 1 | ||
<LinuxNativeSupportEnabled>k__BackingField: 1 | ||
<Il2CppLineNumberSupportEnabled>k__BackingField: 1 | ||
<RuntimeOptionsConfiguration>k__BackingField: {fileID: 11400000, guid: f9a47e8442a604414a84d5ad6da6aa43, | ||
type: 2} | ||
<BuildTimeOptionsConfiguration>k__BackingField: {fileID: 11400000, guid: 1c61999bd2a61408393cfe218d42287e, | ||
<RuntimeOptionsConfiguration>k__BackingField: {fileID: 0} | ||
<BuildTimeOptionsConfiguration>k__BackingField: {fileID: 0} | ||
<OptionsConfiguration>k__BackingField: {fileID: 11400000, guid: cea63afb7c75f429799422326f926abe, | ||
type: 2} | ||
<Debug>k__BackingField: 1 | ||
<DebugOnlyInEditor>k__BackingField: 0 | ||
<DiagnosticLevel>k__BackingField: 0 | ||
<DebugOnlyInEditor>k__BackingField: 1 | ||
<DiagnosticLevel>k__BackingField: 2 |
22 changes: 0 additions & 22 deletions
22
samples/unity-of-bugs/Assets/Scripts/BuildTimeConfiguration.cs
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
samples/unity-of-bugs/Assets/Scripts/BuildTimeConfiguration.cs.meta
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
42 changes: 0 additions & 42 deletions
42
samples/unity-of-bugs/Assets/Scripts/RuntimeConfiguration.cs
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
samples/unity-of-bugs/Assets/Scripts/RuntimeConfiguration.cs.meta
This file was deleted.
Oops, something went wrong.
11 changes: 10 additions & 1 deletion
11
samples/unity-of-bugs/Assets/Scripts/SentryCliConfiguration.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
88 changes: 88 additions & 0 deletions
88
samples/unity-of-bugs/Assets/Scripts/SentryOptionConfiguration.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,88 @@ | ||
using Sentry.Unity; | ||
using UnityEngine; | ||
using UnityEngine.SceneManagement; | ||
|
||
public class SentryOptionConfiguration : SentryOptionsConfiguration | ||
{ | ||
public override void Configure(SentryUnityOptions options) | ||
{ | ||
// Here you can programmatically modify the Sentry option properties used for the SDK's initialization | ||
|
||
#if UNITY_ANDROID || UNITY_IOS | ||
// NOTE! | ||
// On Android and iOS, ALL options configured here will be "baked" into the exported project | ||
// during the build process. | ||
// Changes to the options at runtime will not affect the native SDKs (Java, C/C++, Objective-C) | ||
// and only apply to the C# layer. | ||
|
||
/* | ||
* Sentry Unity SDK - Hybrid Architecture | ||
* ====================================== | ||
* | ||
* Build Time Runtime | ||
* ┌─────────────────────────┐ ┌─────────────────────────┐ | ||
* │ Unity Editor │ │ Game Startup │ | ||
* └──────────┬──────────────┘ └───────────┬─────────────┘ | ||
* │ │ | ||
* ▼ ▼ | ||
* ┌────────────────────────────────────────────────────────────┐ | ||
* │ Options Configuration │ | ||
* │ (This Method) │ | ||
* └─────────────────────────────┬──────────────────────────────┘ | ||
* │ | ||
* ┌───────────────────────────────────┐ | ||
* │ Options used for Init │ | ||
* ▼ ▼ | ||
* ┌──────────────────────────┐ ┌──────────────────────┐ | ||
* │ Native SDK │ │ Unity C# SDK │ | ||
* │ Android & iOS │ │ Initialization │ | ||
* │ ┌────────────────────┐ │ └──────────────────────┘ | ||
* │ │ Options "Baked in" │ │ | ||
* │ └────────────────────┘ │ | ||
* │ The configure call made │ | ||
* │ for this part ran on │ | ||
* │ your build-machine │ | ||
* └──────────────────────────┘ | ||
* │ | ||
* ▼ | ||
* ┌──────────────────────────┐ | ||
* │ Native SDK │ | ||
* │ Android & iOS │ | ||
* └──────────────────────────┘ | ||
*/ | ||
|
||
// Works as expected and will enable all debug logging | ||
// options.Debug = true; | ||
|
||
// Will NOT work as expected. | ||
// This will run twice. | ||
// 1. Once during the build, being baked into the native SDKs | ||
// 2. And a second time every time when the game starts | ||
// options.Release = ComputeVersion(); | ||
#endif | ||
|
||
Debug.Log("OptionConfigure started."); | ||
|
||
// Making sure the SDK is not already initialized during tests | ||
var sceneName = SceneManager.GetActiveScene().name; | ||
if (sceneName != null && sceneName.Contains("TestScene")) | ||
{ | ||
Debug.Log("Disabling the SDK while running tests."); | ||
options.Enabled = false; | ||
} | ||
|
||
// BeforeSend is only relevant at runtime. It wouldn't hurt to be set at build time, just wouldn't do anything. | ||
options.SetBeforeSend((sentryEvent, _) => | ||
{ | ||
if (sentryEvent.Tags.ContainsKey("SomeTag")) | ||
{ | ||
// Don't send events with a tag SomeTag to Sentry | ||
return null; | ||
} | ||
return sentryEvent; | ||
}); | ||
|
||
Debug.Log("OptionConfigure finished."); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
samples/unity-of-bugs/Assets/Scripts/SentryOptionConfiguration.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.