diff --git a/samples/ComputeSharp.SwapChain.Core.Shared/ComputeSharp.SwapChain.Core.Shared.projitems b/samples/ComputeSharp.SwapChain.Core.Shared/ComputeSharp.SwapChain.Core.Shared.projitems
index 80039491..a9b21972 100644
--- a/samples/ComputeSharp.SwapChain.Core.Shared/ComputeSharp.SwapChain.Core.Shared.projitems
+++ b/samples/ComputeSharp.SwapChain.Core.Shared/ComputeSharp.SwapChain.Core.Shared.projitems
@@ -9,6 +9,7 @@
ComputeSharp.SwapChain.Core.Shared
+
diff --git a/samples/ComputeSharp.SwapChain.Core.Shared/Constants/Error.cs b/samples/ComputeSharp.SwapChain.Core.Shared/Constants/Error.cs
new file mode 100644
index 00000000..fa6f2fce
--- /dev/null
+++ b/samples/ComputeSharp.SwapChain.Core.Shared/Constants/Error.cs
@@ -0,0 +1,10 @@
+namespace ComputeSharp.SwapChain.Core.Constants;
+
+///
+/// A with the collection of tracked errors for analytics.
+///
+public static class Error
+{
+ public const string RenderingFailedOnMainPanel = "[SHELL] RenderingFailed (main panel)";
+ public const string RenderingFailedOnSelectionPanel = "[SHELL] RenderingFailed (selection panel)";
+}
diff --git a/samples/ComputeSharp.SwapChain.Core.Shared/Constants/Event.cs b/samples/ComputeSharp.SwapChain.Core.Shared/Constants/Event.cs
index 9d2fe8ad..171865b4 100644
--- a/samples/ComputeSharp.SwapChain.Core.Shared/Constants/Event.cs
+++ b/samples/ComputeSharp.SwapChain.Core.Shared/Constants/Event.cs
@@ -12,6 +12,4 @@ public static class Event
public const string IsRenderingPausedChanged = "[SETTINGS] IsRenderingPaused";
public const string OpenShaderSelectionPanel = "[SHELL] Open ShaderSelectionPanel";
public const string CloseShaderSelectionPanel = "[SHELL] Close ShaderSelectionPanel";
- public const string RenderingFailedOnMainPanel = "[SHELL] RenderingFailed (main panel)";
- public const string RenderingFailedOnSelectionPanel = "[SHELL] RenderingFailed (selection panel)";
}
diff --git a/samples/ComputeSharp.SwapChain.Core.Shared/Services/DebugAnalyticsService.cs b/samples/ComputeSharp.SwapChain.Core.Shared/Services/DebugAnalyticsService.cs
index fdd0b425..c3945e56 100644
--- a/samples/ComputeSharp.SwapChain.Core.Shared/Services/DebugAnalyticsService.cs
+++ b/samples/ComputeSharp.SwapChain.Core.Shared/Services/DebugAnalyticsService.cs
@@ -30,12 +30,11 @@ public sealed class DebugAnalyticsService : IAnalyticsService
}
///
- public void Log(string title, Exception exception, params (string Property, object? Value)[]? data)
+ public void Log(Exception exception, params (string Property, object? Value)[]? data)
{
StringBuilder builder = new();
- builder.AppendLine($"[EXCEPTION]: \"{title}\"");
- builder.AppendLine($">> Type: \"{exception.GetType()}\"");
+ builder.AppendLine($"[EXCEPTION]: \"{exception.GetType()}\"");
builder.AppendLine(">> Stack trace");
builder.AppendLine(exception.StackTrace);
diff --git a/samples/ComputeSharp.SwapChain.Core.Shared/Services/IAnalyticsService.cs b/samples/ComputeSharp.SwapChain.Core.Shared/Services/IAnalyticsService.cs
index 53081e62..d5c0a92e 100644
--- a/samples/ComputeSharp.SwapChain.Core.Shared/Services/IAnalyticsService.cs
+++ b/samples/ComputeSharp.SwapChain.Core.Shared/Services/IAnalyticsService.cs
@@ -17,10 +17,9 @@ public interface IAnalyticsService
void Log(string title, params (string Property, object? Value)[]? data);
///
- /// Logs an exception with a specified title and optional properties.
+ /// Logs an exception with optional properties.
///
- /// The title of the event to track.
/// The exception that has been thrown.
/// The optional event properties.
- void Log(string title, Exception exception, params (string Property, object? Value)[]? data);
+ void Log(Exception exception, params (string Property, object? Value)[]? data);
}
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Services/AppCenterService.cs b/samples/ComputeSharp.SwapChain.Uwp/Services/AppCenterService.cs
index ba7f26b2..13f204c7 100644
--- a/samples/ComputeSharp.SwapChain.Uwp/Services/AppCenterService.cs
+++ b/samples/ComputeSharp.SwapChain.Uwp/Services/AppCenterService.cs
@@ -34,7 +34,7 @@ public sealed class AppCenterService : IAnalyticsService
}
///
- public void Log(string title, Exception exception, params (string Property, object? Value)[]? data)
+ public void Log(Exception exception, params (string Property, object? Value)[]? data)
{
Crashes.TrackError(exception, GetProperties(data));
}
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml.cs b/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml.cs
index d038b3f0..c02b4ab1 100644
--- a/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml.cs
+++ b/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml.cs
@@ -52,12 +52,12 @@ public sealed partial class MainView : UserControl
// Logs rendering failed in the main panel
private void MainShaderPanel_RenderingFailed(AnimatedComputeShaderPanel sender, Exception args)
{
- Ioc.Default.GetRequiredService().Log(Event.RenderingFailedOnMainPanel, args);
+ Ioc.Default.GetRequiredService().Log(args, (nameof(Error), Error.RenderingFailedOnMainPanel));
}
// Logs rendering failed in a secondary panel
private void SelectionShaderPanel_RenderingFailed(AnimatedComputeShaderPanel sender, Exception args)
{
- Ioc.Default.GetRequiredService().Log(Event.RenderingFailedOnSelectionPanel, args);
+ Ioc.Default.GetRequiredService().Log(args, (nameof(Error), Error.RenderingFailedOnSelectionPanel));
}
}