From 2701188f43b6c1015e4e5ef558862690012db782 Mon Sep 17 00:00:00 2001 From: Doonv <58695417+doonv@users.noreply.github.com> Date: Fri, 23 Feb 2024 20:49:32 +0200 Subject: [PATCH] Remove unnecessary wildcards from `LogPlugin` and convert warnings to errors. (#12046) # Objective Improve code quality and prevent bugs. ## Solution I removed the unnecessary wildcards from `::build`. I also changed the warnings that would occur if the subscriber/logger was already set into errors. --- crates/bevy_log/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/bevy_log/src/lib.rs b/crates/bevy_log/src/lib.rs index 36e13f8cd8..4815418640 100644 --- a/crates/bevy_log/src/lib.rs +++ b/crates/bevy_log/src/lib.rs @@ -217,12 +217,12 @@ impl Plugin for LogPlugin { bevy_utils::tracing::subscriber::set_global_default(finished_subscriber).is_err(); match (logger_already_set, subscriber_already_set) { - (true, true) => warn!( + (true, true) => error!( "Could not set global logger and tracing subscriber as they are already set. Consider disabling LogPlugin." ), - (true, _) => warn!("Could not set global logger as it is already set. Consider disabling LogPlugin."), - (_, true) => warn!("Could not set global tracing subscriber as it is already set. Consider disabling LogPlugin."), - _ => (), + (true, false) => error!("Could not set global logger as it is already set. Consider disabling LogPlugin."), + (false, true) => error!("Could not set global tracing subscriber as it is already set. Consider disabling LogPlugin."), + (false, false) => (), } } }