-
-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathAdvancedTab.cs
More file actions
227 lines (186 loc) · 11.5 KB
/
Copy pathAdvancedTab.cs
File metadata and controls
227 lines (186 loc) · 11.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
using System;
using UnityEditor;
using UnityEditor.Build;
using UnityEngine;
namespace Sentry.Unity.Editor.ConfigurationWindow;
internal static class AdvancedTab
{
private static bool UnfoldAutomaticOptions;
private static bool UnfoldNativeOptions;
internal static void Display(ScriptableSentryUnityOptions options, SentryCliOptions? cliOptions)
{
UnfoldAutomaticOptions = EditorGUILayout.BeginFoldoutHeaderGroup(UnfoldAutomaticOptions, "Automatic Behaviour");
EditorGUI.indentLevel++;
if (UnfoldAutomaticOptions)
{
{
options.AutoSessionTracking = EditorGUILayout.BeginToggleGroup(
new GUIContent("Auto Session Tracking", "Whether the SDK should start and end sessions " +
"automatically. If the timeout is reached the old session will" +
"be ended and a new one started."),
options.AutoSessionTracking);
EditorGUI.indentLevel++;
options.AutoSessionTrackingInterval = EditorGUILayout.IntField(
new GUIContent("Timeout [ms]", "The duration of time a session can stay paused " +
"(i.e. the application has been put in the background) before " +
"it is considered ended."),
options.AutoSessionTrackingInterval);
options.AutoSessionTrackingInterval = Mathf.Max(0, options.AutoSessionTrackingInterval);
EditorGUI.indentLevel--;
EditorGUILayout.EndToggleGroup();
}
EditorGUILayout.Space();
EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray);
EditorGUILayout.Space();
{
GUILayout.Label("C# Watchdog", EditorStyles.boldLabel);
options.AnrDetectionEnabled = EditorGUILayout.Toggle(
new GUIContent("Enable", "Whether the SDK should run the C# main-thread watchdog " +
"to report 'Application Not Responding' events."),
options.AnrDetectionEnabled);
options.AnrTimeout = EditorGUILayout.IntField(
new GUIContent("Watchdog Timeout [ms]",
"The duration in [ms] for how long the game has to be unresponsive " +
"before the C# watchdog reports an ANR event.\nDefault: 5000ms"),
options.AnrTimeout);
options.AnrTimeout = Math.Max(0, options.AnrTimeout);
}
EditorGUILayout.Space();
EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray);
EditorGUILayout.Space();
{
GUILayout.Label("App Hang Tracking", EditorStyles.boldLabel);
options.EnableAppHangTracking = EditorGUILayout.Toggle(
new GUIContent("Enable",
"Enables app hang detection via the native SDK. Currently effective on iOS only; " +
"no-op on other platforms until each platform's native hang detection lands."),
options.EnableAppHangTracking);
options.AppHangTimeout = EditorGUILayout.IntField(
new GUIContent("App Hang Timeout [ms]",
"The duration in [ms] for how long the main thread has to be blocked " +
"before an app hang is reported.\nDefault: 5000ms"),
options.AppHangTimeout);
options.AppHangTimeout = Math.Max(0, options.AppHangTimeout);
}
EditorGUILayout.Space();
EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray);
EditorGUILayout.Space();
{
GUILayout.Label("Automatic Exception Filter", EditorStyles.boldLabel);
options.FilterBadGatewayExceptions = EditorGUILayout.Toggle(
new GUIContent("BadGatewayException", "Whether the SDK automatically filters Bad Gateway " +
"exceptions before they are being sent to Sentry."),
options.FilterBadGatewayExceptions);
options.FilterWebExceptions = EditorGUILayout.Toggle(
new GUIContent("WebException", "Whether the SDK automatically filters " +
"System.Net.WebException before they are being sent to Sentry."),
options.FilterWebExceptions);
options.FilterSocketExceptions = EditorGUILayout.Toggle(
new GUIContent("SocketException", "Whether the SDK automatically filters " +
"System.Net.Sockets.SocketException with error code '10049' from " +
"being sent to Sentry."),
options.FilterSocketExceptions);
}
EditorGUILayout.Space();
EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray);
EditorGUILayout.Space();
}
EditorGUI.indentLevel--;
EditorGUILayout.EndFoldoutHeaderGroup();
UnfoldNativeOptions = EditorGUILayout.BeginFoldoutHeaderGroup(UnfoldNativeOptions, "Native Support");
EditorGUI.indentLevel++;
if (UnfoldNativeOptions)
{
GUILayout.Label("Desktop", EditorStyles.boldLabel);
options.WindowsNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("Windows", "Whether to enable native crashes support on Windows."),
options.WindowsNativeSupportEnabled);
options.MacosNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("macOS", "Whether to enable native crashes support on macOS."),
options.MacosNativeSupportEnabled);
options.LinuxNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("Linux", "Whether to enable native crashes support on Linux."),
options.LinuxNativeSupportEnabled);
GUILayout.Label("Mobile", EditorStyles.boldLabel);
options.IosNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("iOS", "Whether to enable Native iOS support to capture" +
"errors written in languages such as Objective-C, Swift, C and C++."),
options.IosNativeSupportEnabled);
options.AndroidNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("Android", "Whether to enable Native Android support to " +
"capture errors written in languages such as Java, Kotlin, C and C++."),
options.AndroidNativeSupportEnabled);
if (options.AndroidNativeSupportEnabled
&& PlayerSettings.GetScriptingBackend(NamedBuildTarget.Android) != ScriptingImplementation.IL2CPP)
{
EditorGUILayout.HelpBox("Android native support requires IL2CPP scripting backend and is currently unsupported on Mono.", MessageType.Warning);
}
EditorGUI.indentLevel++;
EditorGUI.BeginDisabledGroup(!options.AndroidNativeSupportEnabled);
options.NdkIntegrationEnabled = EditorGUILayout.Toggle(
new GUIContent("NDK Integration", "Whether to enable NDK Integration to capture" +
"errors written in languages such C and C++."),
options.NdkIntegrationEnabled);
EditorGUI.BeginDisabledGroup(!options.NdkIntegrationEnabled);
options.NdkScopeSyncEnabled = EditorGUILayout.Toggle(
new GUIContent("NDK Scope Sync", "Whether the SDK should sync the scope to the NDK layer."),
options.NdkScopeSyncEnabled);
EditorGUI.EndDisabledGroup();
EditorGUI.EndDisabledGroup();
EditorGUI.indentLevel--;
GUILayout.Label("Console", EditorStyles.boldLabel);
options.XboxNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("Xbox", "Whether to enable native crash support on Xbox."),
options.XboxNativeSupportEnabled);
options.PlayStationNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("PlayStation", "Whether to enable native crash support on PlayStation."),
options.PlayStationNativeSupportEnabled);
options.SwitchNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("Nintendo Switch", "Whether to enable native scope sync support on Nintendo Switch."),
options.SwitchNativeSupportEnabled);
}
EditorGUI.indentLevel--;
EditorGUILayout.EndFoldoutHeaderGroup();
EditorGUILayout.Space();
EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray);
EditorGUILayout.Space();
{
options.Il2CppLineNumberSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("IL2CPP line numbers", "Whether the SDK should try to to provide line " +
"numbers for exceptions in IL2CPP builds."),
options.Il2CppLineNumberSupportEnabled);
if (options.Il2CppLineNumberSupportEnabled)
{
if (!SentryUnityVersion.IsNewerOrEqualThan("2020.3"))
{
EditorGUILayout.HelpBox("The IL2CPP line number feature is supported from Unity version 2020.3 or newer and 2021.3 or newer onwards", MessageType.Warning);
}
else if (cliOptions is not null && !cliOptions.IsValid(null, EditorUserBuildSettings.development))
{
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
var errorIcon = EditorGUIUtility.IconContent("console.erroricon").image;
var content = new GUIContent("The IL2CPP line number support relies on the Debug Symbol Upload to be enabled and configured." +
"\nAdditionally, this requires an Auth Token, an Org-Slug and the Project Name." +
"\nLearn more about how our IL2CPP support works in our docs.", errorIcon);
EditorGUILayout.LabelField(content, EditorStyles.wordWrappedLabel);
if (GUILayout.Button("Open Documentation", EditorStyles.linkLabel))
{
Application.OpenURL("https://docs.sentry.io/platforms/unity/configuration/il2cpp/");
}
EditorGUILayout.EndVertical();
}
}
}
EditorGUILayout.Space();
EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray);
EditorGUILayout.Space();
{
GUILayout.Label("Metrics", EditorStyles.boldLabel);
options.EnableMetrics = EditorGUILayout.Toggle(
new GUIContent("Enable Metrics",
"Whether the SDK sends metrics to Sentry. " +
"Metrics are connected to traces for correlation."),
options.EnableMetrics);
}
}
}