Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 0 additions & 166 deletions Android/BacktraceAttributes.java

This file was deleted.

32 changes: 0 additions & 32 deletions Android/BacktraceAttributes.java.meta

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Backtrace Unity Release Notes

## Version 3.3.1
- Improved Out-of-memory detection on iOS - Backtrace will report Out-of-memory exceptions when a memory warning occured and the application unexpectly closed. The Out-of-memory watcher will analyse game version, system version, debugger information and even more to determine if application closed by Out-of-memory exception or not.
- Backtrace will no longer send low memory warnings reports from Android or iOS. Instead, Backtrace will utilize iOS OOM detection and extend the embedded native report attributes on Android.
- Users can now enable or disable out-of-memory detection any time via UI/Backtrace API.

## Version 3.3.0
- `BacktraceReport` stack trace now includes the file name of the stack frame.
- Performance improvements:
Expand Down
1 change: 1 addition & 0 deletions Editor/BacktraceClientConfigurationEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public override void OnInspectorGUI()
#endif
#if UNITY_ANDROID || UNITY_IOS
settings.HandleANR = EditorGUILayout.Toggle(BacktraceConfigurationLabels.LABEL_HANDLE_ANR, settings.HandleANR);
settings.OomReports = EditorGUILayout.Toggle(BacktraceConfigurationLabels.LABEL_HANDLE_OOM, settings.OomReports);
#endif
settings.GameObjectDepth = EditorGUILayout.IntField(BacktraceConfigurationLabels.LABEL_GAME_OBJECT_DEPTH, settings.GameObjectDepth);
}
Expand Down
4 changes: 4 additions & 0 deletions Editor/BacktraceConfigurationEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ public override void OnInspectorGUI()
serializedObject.FindProperty("HandleANR"),
new GUIContent(BacktraceConfigurationLabels.LABEL_HANDLE_ANR));

EditorGUILayout.PropertyField(
serializedObject.FindProperty("OomReports"),
new GUIContent(BacktraceConfigurationLabels.LABEL_HANDLE_OOM));

#if UNITY_2019_2_OR_NEWER && UNITY_ANDROID
EditorGUILayout.PropertyField(
serializedObject.FindProperty("SymbolsUploadToken"),
Expand Down
11 changes: 9 additions & 2 deletions Editor/BacktraceConfigurationLabels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@ internal static class BacktraceConfigurationLabels
internal static string LABEL_DESTROY_CLIENT_ON_SCENE_LOAD = "Destroy client on new scene load (false - Backtrace managed)";
internal static string LABEL_SAMPLING = "Log random sampling rate";
internal static string LABEL_HANDLE_ANR = "Handle ANR (Application not responding)";
#if UNITY_ANDROID || UNITY_IOS
internal static string LABEL_HANDLE_OOM =
#if UNITY_ANDROID
"(Early access) Send Low memory warnings to Backtrace";
#elif UNITY_IOS
"(Early access) Send Out of memory exceptions to Backtrace";
#endif
#endif
internal static string CAPTURE_NATIVE_CRASHES = "Capture native crashes";
internal static string LABEL_REPORT_FILTER = "Filter reports";
internal static string LABEL_NUMBER_OF_LOGS = "Collect last n game logs";
internal static string LABEL_GAME_OBJECT_DEPTH = "Game object depth limit";
internal static string LABEL_IGNORE_SSL_VALIDATION = "Ignore SSL validation";
internal static string LABEL_SEND_UNHANDLED_GAME_CRASHES_ON_STARTUP= "Send unhandled native game crashes on startup";
internal static string LABEL_SEND_UNHANDLED_GAME_CRASHES_ON_STARTUP = "Send unhandled native game crashes on startup";
internal static string LABEL_USE_NORMALIZED_EXCEPTION_MESSAGE = "Use normalized exception message";
internal static string LABEL_PERFORMANCE_STATISTICS = "Enable performance statistics";
internal static string LABEL_SYMBOLS_UPLOAD_TOKEN = "Symbols upload token";
Expand All @@ -35,6 +43,5 @@ internal static class BacktraceConfigurationLabels
internal static string LABEL_RETRY_LIMIT = "Maximum retries";
internal static string LABEL_RETRY_ORDER = "Retry order (FIFO/LIFO)";


}
}
32 changes: 18 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- [Prerequisites](#prerequisites)
- [Platforms Supported](#platforms-supported)
- [Setup](#installation)
- [Best Practices](#plugin-best-practices)
- [Plugin Best Practices](#plugin-best-practices)
- [Android Specific information](#android-specific-information)
- [iOS Specific information](#ios-specific-information)
- [Data Privacy](#data-privacy)
Expand All @@ -27,10 +27,12 @@

//Read from manager BacktraceClient instance
var backtraceClient = GameObject.Find("_Manager").GetComponent<BacktraceClient>();
try{
try
{
//throw exception here
}
catch(Exception exception){
catch(Exception exception)
{
var report = new BacktraceReport(exception);
backtraceClient.Send(report);
}
Expand Down Expand Up @@ -70,8 +72,8 @@ Web - WebGL
Game Consoles - PlayStation4, Xbox One, Nintendo Switch
There are some differences in capabilities that backtrace-unity provides based on the platform. Major capabilities are summarized as follows:
* All Platforms - Errors, Unhandled Exceptions, Handled Exceptions, Custom Indexable Metadata, File Attachments*, Last N Log Lines, Automatic attachment of Screenshots, Client Side Deduplication Rules*, Client Side Submission Filtering, Client Side Submission Limits, Performance Diagnostics, Offline Database*(Except Nintendo Switch)
* Android -Identified by attribute `uname.sysname` = Android; ANRs (Hangs), Native Process and Memory Information, Java Exception Handler (Plugins, Exported Game in Android Studio), NDK crashes.
* iOS - Identified by attribute `uname.sysname` = IOS; ANRs (Hangs), Native Engine and Plugin Crashes.
* Android -Identified by attribute `uname.sysname` = Android; ANRs (Hangs), Native Process and Memory Information, Java Exception Handler (Plugins, Exported Game in Android Studio), NDK crashes, low memory warnings.
* iOS - Identified by attribute `uname.sysname` = IOS; ANRs (Hangs), Native Engine, Memory and Plugin Crashes.
* WebGL - Identified by attribute `uname.sysname` = WebGL. The attribute device.model is currently used to share the browser information. Note that stacktraces for WebGL errors are only available if you choose to enable them in the Publishing Settings / Enable Exceptions drop down. More details [here](https://docs.unity3d.com/Manual/webgl-building.html)
* Switch - Identified by attribute `uname.sysname` = Switch. Note that the attribute GUID is regenerated with each Switch restart (It is not an accurate count of number of Users or Devices. It is a count of Switch Sessions). Note that the current release does no support Offline Database or related features.
* PlayStation4 - Identified by attribute `uname.sysname` = PS4
Expand Down Expand Up @@ -135,12 +137,13 @@ If you need to use more advanced configuration, `Initialize` method accepts a `B

# Plugin best practices

The plugin will report on 5 'classes' or errors:
The plugin will report on 6 'classes' or errors:
1) Log Errors - Programmers use [Debug.LogError](https://docs.unity3d.com/ScriptReference/Debug.LogError.html), a variant of Debug.Log, to log error messages to the console.
2) Unhandled Exceptions - Unhandled Exceptions are exceptions in a game that occur outside of an explicit try / catch statement.
3) Handled Exceptions - Exceptions that are explicitly caught and handled.
4) Crashes - An end to the game play experience. The game crashes or restarts.
5) Hangs - A game is non responsive. Some platforms will tell the user "This app has stopped responding"
5) Hangs - A game is non responsive. Some platforms will tell the user “This app has stopped responding
6) Low memory warning - A game is receiving signals from the OS that memory is under pressure or crashed under memory pressure.

The plugin provides 3 controls for managing what the client will report.
- [SkipReports](#filtering-a-report) allows you to tell the client to only report on specific classes of these errors.
Expand Down Expand Up @@ -191,10 +194,11 @@ The backtrace-unity library includes support for capturing Android NDK crashes a

## ANRs and Hangs

When configuring the backtrace-unity client for an Android deployment, programmers will have a toggle available in backtrace-unity GUI in the Unity Editor to enable or disable ANR or Hang reports. This will use the default of 5 seconds. The `error.type` for these reports will be `Hang`.
When configuring the backtrace-unity client for an Android deployment, programmers will have a toggle available in the backtrace-unity GUI in the Unity Editor to enable or disable ANR or Hang reports. This will use the default of 5 seconds. The `error.type` for these reports will be `Hang`.

## Low Memory Reports (Early Access)

## Low Memory Reports
Backtrace can detect low memory situations for a game running in Unity on Android devices, and attempt to generate an error report with an associated dump object for further investigation. The `error.type` for these reports wiill be `Low Memory`.
Backtrace can detect low memory situations for a game running in Unity on Android devices, and attempt to generate an error report with an associated dump object for further investigation. When configuring the backtrace-unity client for an Android deployment, programmers will have a toggle available in the backtrace-unity GUI in the Unity Editor to enable or disable sending Low memory warnings to Backtrace. The `error.type` for these reports wiill be `Low Memory`.

## Symbols upload

Expand All @@ -219,13 +223,13 @@ The backtrace-unity library includes support for capturing native iOS crashes as
system and vm usage related information including system.memory.free, system.memory.used, system.memory.total, system.memory.active, system.memory.inactive, system.memory.wired are avaialble.

## Hangs
When configuring the backtrace-unity client for an iOS deployment, programmers will have a toggle available in backtrace-unity GUI in the Unity Editor to enable or disable ANR or Hang reports. This will use the default of 5 seconds. The `error.type` for these reports will be `Hang`.
When configuring the backtrace-unity client for an iOS deployment, programmers will have a toggle available in the backtrace-unity GUI in the Unity Editor to enable or disable ANR or Hang reports. This will use the default of 5 seconds. The `error.type` for these reports will be `Hang`.

## Low Memory Reports
Backtrace can detect low memory situations for a game running in Unity on iOS devices, and attempt to generate an error report with an associated dump object for further investigation. The `error.type` for these reports wiill be `Low Memory`.
## Low Memory Reports (Early access)
Backtrace can detect low memory situations for a game running in Unity on iOS devices, and attempt to generate an error report with an associated dump object for further investigation. When configuring the backtrace-unity client for an iOS deployment, programmers will have a toggle available in the backtrace-unity GUI in the Unity Editor to enable or disable sending Out of memory exceptions to Backtrace. The `error.type` for these reports wiill be `Low Memory`.

## Native Crashes
When configuring the backtrace-unity client for an iOS deployment in the Unity Editor, programmers will have a toggle to enable or disable `Capture native crashes`. If this is enabled, the backtrace-unity client will ensure the crash report is generated, stored locally, and uploaded upon next game start. Unity crash reporter might prevent Backtrace Crash reporte from sending crashes to Backtrace. To be sure Backtrace is able to collect and send data please set "Enable CrashReport API" to false.
When configuring the backtrace-unity client for an iOS deployment in the Unity Editor, programmers will have a toggle to enable or disable `Capture native crashes`. If this is enabled, the backtrace-unity client will ensure the crash report is generated, stored locally, and uploaded upon next game start. Unity crash reporter might prevent Backtrace Crash reporter from sending crashes to Backtrace. To be sure Backtrace is able to collect and send data please set "Enable CrashReport API" to false.
![Enable symbols](./Documentation~/images/Disable-ios-unity-crash-reporter.png)

## Debug Symbol upload
Expand Down
Loading