about summary refs log tree commit diff
path: root/MatrixRoomUtils.Desktop/SentryService.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-01-24 02:31:56 +0100
committerRory& <root@rory.gay>2024-01-24 17:05:25 +0100
commit03313562d21d5db9bf6a14ebbeab80e06c883d3a (patch)
treee000546a2ee8e6a886a7ed9fd01ad674178fb7cb /MatrixRoomUtils.Desktop/SentryService.cs
parentMake RMU installable (diff)
downloadMatrixUtils-03313562d21d5db9bf6a14ebbeab80e06c883d3a.tar.xz
MRU->RMU, fixes, cleanup
Diffstat (limited to 'MatrixRoomUtils.Desktop/SentryService.cs')
-rw-r--r--MatrixRoomUtils.Desktop/SentryService.cs29
1 files changed, 0 insertions, 29 deletions
diff --git a/MatrixRoomUtils.Desktop/SentryService.cs b/MatrixRoomUtils.Desktop/SentryService.cs
deleted file mode 100644

index 26212fa..0000000 --- a/MatrixRoomUtils.Desktop/SentryService.cs +++ /dev/null
@@ -1,29 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Sentry; - -namespace MatrixRoomUtils.Desktop; - -public class SentryService : IDisposable { - private IDisposable? _sentrySdkDisposable; - public SentryService(IServiceScopeFactory scopeFactory, ILogger<SentryService> logger) { - var config = scopeFactory.CreateScope().ServiceProvider.GetRequiredService<MRUDesktopConfiguration>(); - if (config.SentryDsn is null) { - logger.LogWarning("Sentry DSN is not set, skipping Sentry initialisation"); - return; - } - _sentrySdkDisposable = SentrySdk.Init(o => { - o.Dsn = config.SentryDsn; - // When configuring for the first time, to see what the SDK is doing: - o.Debug = true; - // Set traces_sample_rate to 1.0 to capture 100% of transactions for performance monitoring. - // We recommend adjusting this value in production. - o.TracesSampleRate = 1.0; - // Enable Global Mode if running in a client app - o.IsGlobalModeEnabled = true; - }); - } - - /// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary> - public void Dispose() => _sentrySdkDisposable?.Dispose(); -}