mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
Example of module-level log usage and RUST_LOG usage in main doc (#3919)
# Objective When developing plugins, I very often come up to the need to have logging information printed out. The exact syntax is a bit cryptic, and takes some time to find the documentation. Also a minor typo fix in `It has the same syntax as` part ## Solution Adding a direct example in the module level information for both: 1. Enabling a specific level (`trace` in the example) for a module and all its subsystems at App init 2. Doing the same from console, when launching the application
This commit is contained in:
parent
b6a647cc01
commit
72bb38cad5
1 changed files with 4 additions and 2 deletions
|
@ -55,7 +55,7 @@ use tracing_subscriber::{prelude::*, registry::Registry, EnvFilter};
|
|||
/// App::new()
|
||||
/// .insert_resource(LogSettings {
|
||||
/// level: Level::DEBUG,
|
||||
/// filter: "wgpu=error,bevy_render=info".to_string(),
|
||||
/// filter: "wgpu=error,bevy_render=info,bevy_ecs=trace".to_string(),
|
||||
/// })
|
||||
/// .add_plugins(DefaultPlugins)
|
||||
/// .run();
|
||||
|
@ -63,7 +63,9 @@ use tracing_subscriber::{prelude::*, registry::Registry, EnvFilter};
|
|||
/// ```
|
||||
///
|
||||
/// Log level can also be changed using the `RUST_LOG` environment variable.
|
||||
/// It has the same syntax has the field [`LogSettings::filter`], see [`EnvFilter`].
|
||||
/// For example, using `RUST_LOG=wgpu=error,bevy_render=info,bevy_ecs=trace cargo run ..`
|
||||
///
|
||||
/// It has the same syntax as the field [`LogSettings::filter`], see [`EnvFilter`].
|
||||
/// If you define the `RUST_LOG` environment variable, the [`LogSettings`] resource
|
||||
/// will be ignored.
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue