Skip to content

Commit 1645401

Browse files
authored
Backtrace-unity update 2.0.4 (#9)
## Version 2.0.4 - Added Game object depth property that allows developer to filter game object childrens in Backtrace report - Changed "Destroy client on new scene load" label. Now: "Destroy client on new scene load (false - Backtrace managed), - added namespaces to `XmlNodeConverter` class, - Added correct path to source file in `BacktraceUnhnandledException`, - Changed line endings in `BacktraceDatabase`, `ReportLimitWatcher`, `BacktraceClient` files, - Changed `ReactTransform` casting to `Component` in `Annotations` class. With this change Backtrace library should correctly send all game objects to Backtrace, - Changed a way how we guess game assets directory.
1 parent 51ea280 commit 1645401

16 files changed

+1260
-1201
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Backtrace Unity Release Notes
22

3+
## Version 2.0.4
4+
5+
- Added Game object depth property that allows developer to filter game object childrens in Backtrace report
6+
- Changed "Destroy client on new scene load" label. Now: "Destroy client on new scene load (false - Backtrace managed),
7+
- added namespaces to `XmlNodeConverter` class,
8+
- Added correct path to source file in `BacktraceUnhnandledException`,
9+
- Changed line endings in `BacktraceDatabase`, `ReportLimitWatcher`, `BacktraceClient` files,
10+
- Changed `ReactTransform` casting to `Component` in `Annotations` class. With this change Backtrace library should correctly send all game objects to Backtrace,
11+
- Changed a way how we guess game assets directory.
12+
313
## Version 2.0.3
414

515
- Annotations object will validate game object before converting it.

Editor/Menu/BacktraceClientConfigurationEditor.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ public class BacktraceClientConfigurationEditor : UnityEditor.Editor
1515
public const string LABEL_HANDLE_UNHANDLED_EXCEPTION = "Handle unhandled exceptions";
1616
public const string LABEL_IGNORE_SSL_VALIDATION = "Ignore SSL validation";
1717
public const string LABEL_DEDUPLICATION_RULES = "Deduplication rules";
18-
public const string LABEL_DONT_DESTROY_BACKTRACE_ON_SCENE_LOAD = "Don't destroy on scene load";
18+
public const string LABEL_GAME_OBJECT_DEPTH = "Game object depth limit";
1919

20+
public const string LABEL_DESTROY_CLIENT_ON_SCENE_LOAD = "Destroy client on new scene load (false - Backtrace managed)";
2021

2122

22-
23-
private const string CONFIG_NAME = "backtrace_client_config";
24-
2523
public override void OnInspectorGUI()
2624
{
2725
var settings = (BacktraceClientConfiguration)target;
@@ -30,14 +28,15 @@ public override void OnInspectorGUI()
3028
settings.UpdateServerUrl();
3129
if (!settings.ValidateServerUrl())
3230
{
33-
EditorGUILayout.HelpBox("Detected different pattern of url. Please make sure its a valid Backtrace url!", MessageType.Warning);
31+
EditorGUILayout.HelpBox("Detected different pattern of url. Please make sure you passed valid Backtrace url", MessageType.Warning);
3432
}
3533

36-
settings.DestroyOnLoad = EditorGUILayout.Toggle(LABEL_DONT_DESTROY_BACKTRACE_ON_SCENE_LOAD, settings.DestroyOnLoad);
34+
settings.DestroyOnLoad = EditorGUILayout.Toggle(LABEL_DESTROY_CLIENT_ON_SCENE_LOAD, settings.DestroyOnLoad);
3735
settings.ReportPerMin = EditorGUILayout.IntField(LABEL_REPORT_PER_MIN, settings.ReportPerMin);
3836
settings.HandleUnhandledExceptions = EditorGUILayout.Toggle(LABEL_HANDLE_UNHANDLED_EXCEPTION, settings.HandleUnhandledExceptions);
3937
settings.IgnoreSslValidation = EditorGUILayout.Toggle(LABEL_IGNORE_SSL_VALIDATION, settings.IgnoreSslValidation);
4038
settings.DeduplicationStrategy = (DeduplicationStrategy)EditorGUILayout.EnumPopup(LABEL_DEDUPLICATION_RULES, settings.DeduplicationStrategy);
39+
settings.GameObjectDepth = EditorGUILayout.IntField(LABEL_GAME_OBJECT_DEPTH, settings.GameObjectDepth);
4140
}
4241
}
4342

Editor/Menu/BacktraceConfigurationEditor.cs

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#if UNITY_EDITOR
22
using Backtrace.Unity.Model;
3+
using Backtrace.Unity.Model.JsonData;
34
using UnityEditor;
45
using UnityEngine;
56

@@ -14,8 +15,9 @@ public class BacktraceConfigurationEditor : UnityEditor.Editor
1415
public const string LABEL_ENABLE_DATABASE = "Enable Database";
1516
public const string LABEL_IGNORE_SSL_VALIDATION = "Ignore SSL validation";
1617
public const string LABEL_DEDUPLICATION_RULES = "Deduplication rules";
18+
public const string LABEL_GAME_OBJECT_DEPTH = "Game object depth limit";
1719

18-
public const string LABEL_DESTROY_CLIENT_ON_SCENE_LOAD = "Destroy client on new scene load";
20+
public const string LABEL_DESTROY_CLIENT_ON_SCENE_LOAD = "Destroy client on new scene load (false - Backtrace managed)";
1921

2022
public const string LABEL_PATH = "Backtrace database path";
2123
public const string LABEL_AUTO_SEND_MODE = "Auto send mode";
@@ -38,56 +40,65 @@ public override void OnInspectorGUI()
3840
EditorGUILayout.HelpBox("Please insert valid Backtrace server url!", MessageType.Error);
3941
}
4042

41-
EditorGUILayout.PropertyField(serializedObject.FindProperty("ReportPerMin"), new GUIContent(LABEL_REPORT_PER_MIN));
43+
EditorGUILayout.PropertyField(serializedObject.FindProperty(nameof(BacktraceConfiguration.ReportPerMin)), new GUIContent(LABEL_REPORT_PER_MIN));
4244

43-
SerializedProperty unhandledExceptions = serializedObject.FindProperty("HandleUnhandledExceptions");
45+
SerializedProperty unhandledExceptions = serializedObject.FindProperty(nameof(BacktraceConfiguration.HandleUnhandledExceptions));
4446
EditorGUILayout.PropertyField(unhandledExceptions, new GUIContent(LABEL_HANDLE_UNHANDLED_EXCEPTION));
4547

46-
SerializedProperty sslValidation = serializedObject.FindProperty("IgnoreSslValidation");
48+
SerializedProperty sslValidation = serializedObject.FindProperty(nameof(BacktraceConfiguration.IgnoreSslValidation));
4749
EditorGUILayout.PropertyField(sslValidation, new GUIContent(LABEL_IGNORE_SSL_VALIDATION));
4850

4951

50-
SerializedProperty deduplicationStrategy = serializedObject.FindProperty("DeduplicationStrategy");
52+
SerializedProperty deduplicationStrategy = serializedObject.FindProperty(nameof(BacktraceConfiguration.DeduplicationStrategy));
5153
EditorGUILayout.PropertyField(deduplicationStrategy, new GUIContent(LABEL_DEDUPLICATION_RULES));
5254

53-
SerializedProperty destroyOnLoad = serializedObject.FindProperty("DestroyOnLoad");
55+
SerializedProperty destroyOnLoad = serializedObject.FindProperty(nameof(BacktraceConfiguration.DestroyOnLoad));
5456
EditorGUILayout.PropertyField(destroyOnLoad, new GUIContent(LABEL_DESTROY_CLIENT_ON_SCENE_LOAD));
5557

56-
SerializedProperty enabled = serializedObject.FindProperty("Enabled");
57-
EditorGUILayout.PropertyField(enabled, new GUIContent(LABEL_ENABLE_DATABASE));
58+
59+
SerializedProperty gameObjectDepth = serializedObject.FindProperty(nameof(BacktraceConfiguration.GameObjectDepth));
60+
EditorGUILayout.PropertyField(gameObjectDepth, new GUIContent(LABEL_GAME_OBJECT_DEPTH));
61+
62+
if (gameObjectDepth.intValue < 0)
63+
{
64+
EditorGUILayout.HelpBox("Please inser value greater or equal 0", MessageType.Error);
65+
}
66+
67+
SerializedProperty enabled = serializedObject.FindProperty(nameof(BacktraceConfiguration.Enabled));
68+
EditorGUILayout.PropertyField(enabled, new GUIContent(LABEL_ENABLE_DATABASE));
5869

5970
if (enabled.boolValue)
6071
{
6172
EditorGUILayout.LabelField("Backtrace Database settings.");
6273

63-
SerializedProperty databasePath = serializedObject.FindProperty("DatabasePath");
74+
SerializedProperty databasePath = serializedObject.FindProperty(nameof(BacktraceConfiguration.DatabasePath));
6475
EditorGUILayout.PropertyField(databasePath, new GUIContent(LABEL_PATH));
6576
if (string.IsNullOrEmpty(databasePath.stringValue))
6677
{
6778
EditorGUILayout.HelpBox("Please insert valid Backtrace database path!", MessageType.Error);
6879
}
6980

70-
SerializedProperty autoSendMode = serializedObject.FindProperty("AutoSendMode");
81+
SerializedProperty autoSendMode = serializedObject.FindProperty(nameof(BacktraceConfiguration.AutoSendMode));
7182
EditorGUILayout.PropertyField(autoSendMode, new GUIContent(LABEL_AUTO_SEND_MODE));
7283

7384

74-
SerializedProperty createDatabase = serializedObject.FindProperty("CreateDatabase");
85+
SerializedProperty createDatabase = serializedObject.FindProperty(nameof(BacktraceConfiguration.CreateDatabase));
7586
EditorGUILayout.PropertyField(createDatabase, new GUIContent(LABEL_CREATE_DATABASE_DIRECTORY));
7687

77-
SerializedProperty maxRecordCount = serializedObject.FindProperty("MaxRecordCount");
88+
SerializedProperty maxRecordCount = serializedObject.FindProperty(nameof(BacktraceConfiguration.MaxRecordCount));
7889
EditorGUILayout.PropertyField(maxRecordCount, new GUIContent(LABEL_MAX_REPORT_COUNT));
7990

80-
SerializedProperty maxDatabaseSize = serializedObject.FindProperty("MaxDatabaseSize");
91+
SerializedProperty maxDatabaseSize = serializedObject.FindProperty(nameof(BacktraceConfiguration.MaxDatabaseSize));
8192
EditorGUILayout.PropertyField(maxDatabaseSize, new GUIContent(LABEL_MAX_DATABASE_SIZE));
8293

83-
SerializedProperty retryInterval = serializedObject.FindProperty("RetryInterval");
94+
SerializedProperty retryInterval = serializedObject.FindProperty(nameof(BacktraceConfiguration.RetryInterval));
8495
EditorGUILayout.PropertyField(retryInterval, new GUIContent(LABEL_RETRY_INTERVAL));
8596

8697
EditorGUILayout.LabelField("Backtrace database require at least one retry.");
87-
SerializedProperty retryLimit = serializedObject.FindProperty("RetryLimit");
98+
SerializedProperty retryLimit = serializedObject.FindProperty(nameof(BacktraceConfiguration.RetryLimit));
8899
EditorGUILayout.PropertyField(retryLimit, new GUIContent(LABEL_RETRY_LIMIT));
89100

90-
SerializedProperty retryOrder = serializedObject.FindProperty("RetryOrder");
101+
SerializedProperty retryOrder = serializedObject.FindProperty(nameof(BacktraceConfiguration.RetryOrder));
91102
EditorGUILayout.PropertyField(retryOrder, new GUIContent(LABEL_RETRY_ORDER));
92103
}
93104

Editor/Tests/BacktraceStackTraceTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Tests
1313
{
1414
public class BacktraceStackTraceTests
1515
{
16-
private static readonly List<SampleStackFrame> _advancedStack = new List<SampleStackFrame>()
16+
private readonly List<SampleStackFrame> _advancedStack = new List<SampleStackFrame>()
1717
{
1818
new SampleStackFrame(){
1919
Method ="InvalidSignatureException: Return type System.Void of GenerateSubmissionUrl_FromValidHostName_ValidSubmissionUrl in Tests.BacktraceCredentialsTests is not supported."
@@ -44,7 +44,7 @@ public class BacktraceStackTraceTests
4444
},
4545
};
4646

47-
private static readonly List<SampleStackFrame> _simpleStack = new List<SampleStackFrame>()
47+
private readonly List<SampleStackFrame> _simpleStack = new List<SampleStackFrame>()
4848
{
4949
new SampleStackFrame()
5050
{
@@ -139,7 +139,7 @@ public IEnumerator TestStackTraceCreation_UnityEngineException_ValidStackTraceOb
139139
var realStackFrame = data[i];
140140
Assert.AreEqual(realStackFrame.Method, backtraceStackFrame.FunctionName);
141141
Assert.AreEqual(realStackFrame.LineNumber, backtraceStackFrame.Line);
142-
Assert.AreEqual(realStackFrame.Path, backtraceStackFrame.SourceCode);
142+
Assert.AreEqual(realStackFrame.Path, backtraceStackFrame.Library);
143143
}
144144
// -1 because we include header in stack trace
145145
Assert.AreEqual(data.Count - startIndex, backtraceStackTrace.StackFrames.Count);

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ The following is a reference guide to the Backtrace Client fields:
6565
- Reports per minute: Limits the number of reports the client will send per minutes. If set to 0, there is no limit. If set to a higher value and the value is reached, the client will not send any reports until the next minute. Further, the BacktraceClient.Send/BacktraceClient.SendAsync method will return false.
6666
- Destroy client on new scene load - Backtrace-client by default will be available on each scene. Once you initialize Backtrace integration, you can fetch Backtrace game object from every scene. In case if you don't want to have Backtrace-unity integration available by default in each scene, please set this value to true.
6767
- Handle unhandled exceptions: Toggle this on or off to set the library to handle unhandled exceptions that are not captured by try-catch blocks.
68+
- Game Object Depth Limit: Allows developer to filter number of game object childrens in Backtrace report.
6869
- Ignore SSL validation: Unity by default will validate ssl certificates. By using this option you can avoid ssl certificates validation. However, if you don't need to ignore ssl validation, please set this option to false.
6970
- Deduplication rules: Backtrace-unity plugin allows you to combine the same reports. By using deduplication rules, you can tell backtrace-unity plugin how we should merge reports.
7071
- Enable Database: When this setting is toggled, the backtrace-unity plugin will configure an offline database that will store reports if they can't be submitted do to being offline or not finding a network. When toggled on, there are a number of Database settings to configure.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Backtrace-unity",
33
"displayName": "Backtrace-Unity",
4-
"version": "1.1.5",
4+
"version": "2.0.4",
55
"unity": "2017.1",
66
"description": "Backtrace's integration with Unity games allows customers to capture and report handled and unhandled Unity exceptions to their Backtrace instance, instantly offering the ability to prioritize and debug software errors.",
77
"keywords": [

0 commit comments

Comments
 (0)