Skip to content

feat: Added ANR options #1181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 22, 2023
Merged

feat: Added ANR options #1181

merged 8 commits into from
Feb 22, 2023

Conversation

bitsandfoxes
Copy link
Contributor

The ANR feature was missing an opt-out on the editor window. While at it I surfaced the timeout.

@bitsandfoxes bitsandfoxes requested a review from vaind February 14, 2023 13:26
Comment on lines +11 to +48
{
options.Debug = EditorGUILayout.BeginToggleGroup(
new GUIContent("Enable Debug Output", "Whether the Sentry SDK should print its " +
"diagnostic logs to the console."),
options.Debug);

options.DebugOnlyInEditor = EditorGUILayout.Toggle(
new GUIContent("Only In Editor", "Only print logs when in the editor. Development " +
"builds of the player will not include Sentry's SDK diagnostics."),
options.DebugOnlyInEditor);

options.DiagnosticLevel = (SentryLevel)EditorGUILayout.EnumPopup(
new GUIContent("Verbosity Level", "The minimum level allowed to be printed to the console. " +
"Log messages with a level below this level are dropped."),
options.DiagnosticLevel);

EditorGUILayout.EndToggleGroup();
}

options.DiagnosticLevel = (SentryLevel)EditorGUILayout.EnumPopup(
new GUIContent("Verbosity Level", "The minimum level allowed to be printed to the console. " +
"Log messages with a level below this level are dropped."),
options.DiagnosticLevel);
EditorGUILayout.Space();
EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray);
EditorGUILayout.Space();

EditorGUILayout.EndToggleGroup();
{
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);

options.AutoSessionTrackingInterval = EditorGUILayout.IntField(
new GUIContent("Session 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);
EditorGUILayout.EndToggleGroup();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please disregard. This is just an added indentation to help navigate this file.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 14, 2023

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 630e667

Comment on lines +75 to +97
{
options.IosNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("iOS Native Support", "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 Native Support", "Whether to enable Native Android support to " +
"capture errors written in languages such as Java, Kotlin, C and C++."),
options.AndroidNativeSupportEnabled);

options.WindowsNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("Windows Native Support", "Whether to enable native crashes support on Windows."),
options.WindowsNativeSupportEnabled);

options.MacosNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("macOS Native Support", "Whether to enable native crashes support on macOS."),
options.MacosNativeSupportEnabled);

options.LinuxNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("Linux Native Support", "Whether to enable native crashes support on Linux."),
options.LinuxNativeSupportEnabled);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please disregard. This is just an added indentation to help navigate this file.

Comment on lines +104 to +118
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)
{
EditorGUILayout.HelpBox("The IL2CPP line number support relies on the Debug Symbol Upload to be properly set up.", MessageType.Error);
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.HelpBox("The IL2CPP line number support relies on the Debug Symbol Upload to be properly set up.", MessageType.Error);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please disregard. This is just an added indentation to help navigate this file.

@bitsandfoxes bitsandfoxes merged commit da4fd61 into main Feb 22, 2023
@bitsandfoxes bitsandfoxes deleted the feat/anr-options branch February 22, 2023 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants