From 10bf503c89a15f44133117034e5228d831606ce2 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Thu, 13 Jan 2022 14:42:46 -0600 Subject: [PATCH] Only log panics in release builds. --- src/error.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/error.rs b/src/error.rs index 7e1f23a..9a21b6d 100644 --- a/src/error.rs +++ b/src/error.rs @@ -53,7 +53,9 @@ pub struct ErrorPlugin; impl Plugin for ErrorPlugin { fn build(&self, app: &mut App) { - init_panic_handler(); + if !cfg!(debug_assertions) { + init_panic_handler(); + } if let Some(config) = app.world.get_resource::() { if let Some(dsn) = &config.sentry_dsn { let guard = sentry::init(dsn.clone());