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 `<LogPlugin as Plugin>::build`. I also changed the warnings that would occur if the subscriber/logger was already set into errors.
This commit is contained in:
parent
5bf5d48759
commit
784b9bd945
@ -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) => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user