Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling logging with log crate and it's features doesn't work #17226

Open
Phoqinu opened this issue Jan 8, 2025 · 1 comment
Open

Disabling logging with log crate and it's features doesn't work #17226

Phoqinu opened this issue Jan 8, 2025 · 1 comment
Labels
A-Diagnostics Logging, crash handling, error reporting and performance analysis C-Bug An unexpected or incorrect behavior S-Needs-Investigation This issue requires detective work to figure out what's going wrong

Comments

@Phoqinu
Copy link
Contributor

Phoqinu commented Jan 8, 2025

Bevy version

0.15.0, 0.15.1

What you did

This dependencies:

[dependencies]
bevy = "0.15.1"
log = { version = "*", features = [
    "max_level_off",
    "release_max_level_off"
] } 

and this app (doesn't matter if it's debug or release build):

use bevy::prelude::*;

fn main() -> AppExit {
    App::new().add_plugins(DefaultPlugins).add_systems(Startup, || {
        error!("this shouldn't happen!");
    }).run()
}

will print into console:

2025-01-07T23:59:05.547370Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 11 Enterprise", kernel: "22631", cpu: "AMD Ryzen 9 5900X 12-Core Processor", core_count: "12", memory: "63.9 GiB" }
2025-01-07T23:59:05.742910Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce GTX 1080", vendor: 4318, device: 7040, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "566.36", backend: Vulkan }
2025-01-07T23:59:05.936074Z  INFO bevy_winit::system: Creating new window "App" (0v1#4294967296)
2025-01-07T23:59:05.965325Z ERROR bevy_log_test: this shouldn't happen!

and then when we close the window:

2025-01-07T23:59:08.711962Z  INFO bevy_window::system: No windows are open, exiting
2025-01-07T23:59:08.712379Z  INFO bevy_winit::system: Closing window 0v1#4294967296
2025-01-07T23:59:08.712897Z  INFO bevy_window::system: No windows are open, exiting

What went wrong

Bevy's page says here that log's features can be used to disable logging below that level.

This:

log = { version = "*", features = [
    "max_level_off",
    "release_max_level_off"
] } 

should disable all logging in debug/release but I can still see logs in console.

Using bevy's setup's features:

log = { version = "*", features = [
    "max_level_debug",
    "release_max_level_warn"
] } 

still result's in info logs in console in release mode.

@Phoqinu Phoqinu added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jan 8, 2025
@BenjaminBrienen BenjaminBrienen added S-Needs-Investigation This issue requires detective work to figure out what's going wrong A-Diagnostics Logging, crash handling, error reporting and performance analysis and removed S-Needs-Triage This issue needs to be labelled labels Jan 8, 2025
@Elabajaba
Copy link
Contributor

You may need to add tracing with those same features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Diagnostics Logging, crash handling, error reporting and performance analysis C-Bug An unexpected or incorrect behavior S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

No branches or pull requests

3 participants