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

Overwhelming amount of logs with egui 0.29 #26

Open
izolyomi opened this issue Dec 13, 2024 · 1 comment
Open

Overwhelming amount of logs with egui 0.29 #26

izolyomi opened this issue Dec 13, 2024 · 1 comment

Comments

@izolyomi
Copy link

After updating to egui 0.29, my app with an embedded egui_logger component always freezes. This is not a direct problem in egui_logger itself but in the egui ecosystem and I'm not sure how to overcome this.

Some dependencies are using the log crate, some other are using tracing with tracing-subscriber. Recent egui 0.29 updated its winit dependency to 0.30 which uses tracing internally. With the default winit features, a log message is sent for each winit frame span. As far as I understand this becomes a problem only when tracing-subscriber is also present and the tracing logs are actually translated into and delivered as logs of the log crate. This overwhelming amount of logs (multiple ones for each calculated frame) makes the egui_logger inresponsive and the app freezes.

Can you see a way to prevent or overcome this problem? This even more cumbersome because this breaking change happened in a patch version between egui_logger 0.6.0 and 0.6.1 so it always occurs unless I stick with exactly 0.6.0 preventing the upgrade.

@RegenJacob
Copy link
Owner

RegenJacob commented Dec 15, 2024

I was able to reproduce the problem by adding this to my Cargo.toml file:

tracing = { version = "0.1", features = ["log", "log-always"]}

It looks like winit is writing a ton of debug and trace messages, which is overwhelming for a UI logger like egui_logger.

The trace level was basically always unusable; it produces way too much info. While we might be able to filter out some of this stuff in the future ("tracing events < Info" or something).

To temporarily fix this issue, you can try setting the maximum log level for egui_logger to Info like so:

egui_logger
    .builder
    .max_level(LevelFilter::Info)
    // ...

Or if you're using a multi-logger setup, just set the global max level to Info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants