Open SludgePhD opened 7 months ago
Could you provide a code example? I just tested the LogTracer (tracing-log) like it is used in bevy (https://github.com/bevyengine/bevy/blob/main/crates/bevy_log/src/lib.rs), and it seems to work fine for me... Changelogs are btw here (tracing-log) and here (tracing-subscriber).
Ah, I looked into https://github.com/tokio-rs/tracing/blob/master/tracing-log/CHANGELOG.md, which hasn't been updated
It is on the v0.1.x branch (https://github.com/tokio-rs/tracing/blob/v0.1.x/tracing-log/CHANGELOG.md) :)
This reproduces it:
use bevy::{app::App, log::LogPlugin};
fn main() {
App::new().add_plugins(LogPlugin::default());
tracing::error!("via tracing");
log::error!("via log");
}
With these dependencies:
[dependencies]
bevy = { version = "0.13.0", default-features = false }
tracing = "0.1.40"
log = "0.4.20"
Output with up-to-date dependencies:
Running `target/debug/hello`
2024-02-27T21:49:11.237546Z ERROR hello: via tracing
2024-02-27T21:49:11.237574Z ERROR log: via log
Output after cargo update -p tracing-subscriber --precise 0.3.17
:
Running `target/debug/hello`
2024-02-27T21:49:53.488578Z ERROR hello: via tracing
2024-02-27T21:49:53.488605Z ERROR hello: via log
As you can see, tracing-subscriber
0.3.18 misattributes every use of the log
crate's macros to the log
crate itself, presumably because the two copies of the tracing-log
crate don't interact well.
Hmm it looks like this is fixed with the latest bevy version because they updated tracing-log
to 0.2.0 (https://github.com/bevyengine/bevy/pull/10404). Could you please check as well?
Yes, bevy's main
branch doesn't have the issue. But there is still seemingly a breaking change published in a non-breaking update of tracing-subscriber
.
Bug Report
Version
Platform
Crates
tracing-subscriber and possibly tracing-log.
bevy_log
directly depends on tracing-log 0.1, but tracing-subscriber 0.3.18 updates to tracing-log 0.2.It's possible that
bevy_log
does something inappropriate here and is to blame instead. However, neithertracing-subscriber
nottracing-log
maintain changelogs, so I'm blaming tracing for not communicating what's going on properly.Description
Log output with tracing-subscriber 0.3.17:
Log output after updating to tracing-subscriber 0.3.18:
Instead of proper module and crate names everything is attributed to "log".