From 08ce7aaa335a71169d8f7d0757c993ae05a97dbc Mon Sep 17 00:00:00 2001 From: bricefriha Date: Wed, 22 Jan 2025 12:40:27 +0000 Subject: [PATCH] Error handling - Sentry | disable Sentry for debug --- App/MauiProgram.cs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/App/MauiProgram.cs b/App/MauiProgram.cs index c1f1b14c..dd7ff384 100644 --- a/App/MauiProgram.cs +++ b/App/MauiProgram.cs @@ -15,24 +15,21 @@ public static MauiApp CreateMauiApp() #endif builder.UseMauiApp() .UseSentry(options => { - // The DSN is the only required setting. - options.Dsn = "https://6a618edd553c62a09273c0899febf030@o4508638278844416.ingest.de.sentry.io/4508638282580048"; + +#if DEBUG + // Sentry just pollute my logs in Debug so I disabled it + options.Dsn = ""; +#else + // The DSN is the only required setting. + options.Dsn = "https://6a618edd553c62a09273c0899febf030@o4508638278844416.ingest.de.sentry.io/4508638282580048"; +#endif - // Use debug mode if you want to see what the SDK is doing. - // Debug messages are written to stdout with Console.Writeline, - // and are viewable in your IDE's debug console or with 'adb logcat', etc. - // This option is not recommended when deploying your application. #if DEBUG options.Debug = true; #else options.Debug = false; #endif - - // Set TracesSampleRate to 1.0 to capture 100% of transactions for tracing. - // We recommend adjusting this value in production. options.TracesSampleRate = 1.0; - - // Other Sentry options can be set here. }) .ConfigureFonts(fonts => {