mirror of
https://github.com/bevyengine/bevy
synced 2024-11-25 22:20:20 +00:00
Move the default LogPlugin filter to a public constant (#14958)
# Objective This moves the default `LogPlugin` filter to be a public constant so that it can be updated and referenced from outside code without changes across releases: ``` fn main() { App::new().add_plugins( DefaultPlugins .set(bevy::log::LogPlugin { filter: format!("{},mylogs=error", bevy::log::LogPlugin::DEFAULT_FILTER), ..default() })).run(); } ``` ## Testing Tested with `cargo run -p ci`
This commit is contained in:
parent
4be8e497ca
commit
e600e2c1b1
1 changed files with 4 additions and 1 deletions
|
@ -157,10 +157,13 @@ pub struct LogPlugin {
|
||||||
/// A boxed [`Layer`] that can be used with [`LogPlugin`].
|
/// A boxed [`Layer`] that can be used with [`LogPlugin`].
|
||||||
pub type BoxedLayer = Box<dyn Layer<Registry> + Send + Sync + 'static>;
|
pub type BoxedLayer = Box<dyn Layer<Registry> + Send + Sync + 'static>;
|
||||||
|
|
||||||
|
/// The default [`LogPlugin`] [`EnvFilter`].
|
||||||
|
pub const DEFAULT_FILTER: &str = "wgpu=error,naga=warn";
|
||||||
|
|
||||||
impl Default for LogPlugin {
|
impl Default for LogPlugin {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
filter: "wgpu=error,naga=warn".to_string(),
|
filter: DEFAULT_FILTER.to_string(),
|
||||||
level: Level::INFO,
|
level: Level::INFO,
|
||||||
custom_layer: |_| None,
|
custom_layer: |_| None,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue