Skip to content

Commit

Permalink
Update macos native client
Browse files Browse the repository at this point in the history
melekr committed Aug 30, 2024
1 parent dce9ddf commit cd544dc
Showing 7 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Editor/BacktraceClientConfigurationEditor.cs
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ public override void OnInspectorGUI()
#else
settings.IgnoreSslValidation = false;
#endif
#if UNITY_ANDROID || UNITY_IOS
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX
settings.HandleANR = EditorGUILayout.Toggle(BacktraceConfigurationLabels.LABEL_HANDLE_ANR, settings.HandleANR);
settings.OomReports = EditorGUILayout.Toggle(BacktraceConfigurationLabels.LABEL_HANDLE_OOM, settings.OomReports);
#endif
2 changes: 1 addition & 1 deletion Editor/BacktraceConfigurationEditor.cs
Original file line number Diff line number Diff line change
@@ -153,7 +153,7 @@ public override void OnInspectorGUI()
serializedObject.FindProperty("HandleANR"),
new GUIContent(BacktraceConfigurationLabels.LABEL_HANDLE_ANR));
#endif
#if UNITY_ANDROID || UNITY_IOS
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX
EditorGUILayout.PropertyField(
serializedObject.FindProperty("OomReports"),
new GUIContent(BacktraceConfigurationLabels.LABEL_HANDLE_OOM));
6 changes: 3 additions & 3 deletions Runtime/BacktraceClient.cs
Original file line number Diff line number Diff line change
@@ -712,7 +712,7 @@ private void OnDestroy()
_instance = null;
Application.logMessageReceived -= HandleUnityMessage;
Application.logMessageReceivedThreaded -= HandleUnityBackgroundException;
#if UNITY_ANDROID || UNITY_IOS
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX
Application.lowMemory -= HandleLowMemory;
#endif
if (_nativeClient != null)
@@ -1040,7 +1040,7 @@ private void CaptureUnityMessages()
{
Application.logMessageReceived += HandleUnityMessage;
Application.logMessageReceivedThreaded += HandleUnityBackgroundException;
#if UNITY_ANDROID || UNITY_IOS
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX
Application.lowMemory += HandleLowMemory;
#endif
}
@@ -1069,7 +1069,7 @@ internal void HandleUnityBackgroundException(string message, string stackTrace,
HandleUnityMessage(message, stackTrace, type);
}

#if UNITY_ANDROID || UNITY_IOS
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX
internal void HandleLowMemory()
{
if (!Enabled)
4 changes: 4 additions & 0 deletions Runtime/Model/Attributes/MachineAttributeProvider.cs
Original file line number Diff line number Diff line change
@@ -90,6 +90,10 @@ private void IncludeOsInformation(IDictionary<string, string> attributes)
attributes["uname.version"] = UnityEngine.iOS.Device.systemVersion;
attributes["uname.fullname"] = Environment.OSVersion.Version.ToString();
#endif

#if UNITY_STANDALONE_OSX && !UNITY_EDITOR
attributes["uname.fullname"] = Environment.OSVersion.Version.ToString();
#endif
}

private void IncludeGraphicCardInformation(IDictionary<string, string> attributes)
8 changes: 4 additions & 4 deletions Runtime/Model/BacktraceConfiguration.cs
Original file line number Diff line number Diff line change
@@ -146,7 +146,7 @@ public class BacktraceConfiguration : ScriptableObject
/// <summary>
/// Handle ANR events - Application not responding
/// </summary>
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_WIN
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN
[Tooltip("Capture ANR events - Application not responding")]
#else
[Obsolete("Not supported")]
@@ -157,7 +157,7 @@ public class BacktraceConfiguration : ScriptableObject
/// <summary>
/// Anr watchdog timeout in ms. Time needed to detect an ANR event
/// </summary>
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_WIN
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN
[Tooltip("ANR watchdog timeout")]
#else
[Obsolete("Not supported")]
@@ -167,7 +167,7 @@ public class BacktraceConfiguration : ScriptableObject
/// <summary>
/// Send Out of memory exceptions to Backtrace.
/// </summary>
#if UNITY_ANDROID || UNITY_IOS
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX
[Tooltip("Send Out of Memory exceptions to Backtrace")]
#else
[Obsolete("Not supported")]
@@ -177,7 +177,7 @@ public class BacktraceConfiguration : ScriptableObject
/// <summary>
/// Enable client side unwinding.
/// </summary>
#if UNITY_2019_2_OR_NEWER && (UNITY_ANDROID || UNITY_IOS)
#if UNITY_2019_2_OR_NEWER && (UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX)
[Tooltip("Enable client-side unwinding.")]
#else
[Obsolete("Not supported")]
2 changes: 1 addition & 1 deletion Tests/Runtime/Native/BreadcrumbsAnrTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_WIN
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN
using Backtrace.Unity.Model;
using Backtrace.Unity.Model.Breadcrumbs;
using Backtrace.Unity.Model.Breadcrumbs.InMemory;
2 changes: 1 addition & 1 deletion Tests/Runtime/Native/Mocks/TestableNativeClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_WIN
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN
using Backtrace.Unity.Model;
using Backtrace.Unity.Model.Breadcrumbs;
using Backtrace.Unity.Runtime.Native;

0 comments on commit cd544dc

Please sign in to comment.