Skip to content

Commit

Permalink
Update tracy and tracing crates
Browse files Browse the repository at this point in the history
Required for the newest Tracy release.
  • Loading branch information
YaLTeR committed Nov 10, 2024
1 parent 224976b commit ba34330
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ serde = { version = "1.0.174", features = ["derive"] }
serde_json = "1.0.103"
tap = "1.0.1"
thiserror = "1.0.44"
tracing = "0.1.37"
tracing-chrome = "0.7.1"
tracing-subscriber = "0.3.17"
tracing-tracy = { version = "0.10.3", optional = true }
tracy-client = { version = "0.16.1", optional = true }
tracing = "0.1.40"
tracing-chrome = "0.7.2"
tracing-subscriber = "0.3.18"
tracing-tracy = { version = "0.11.3", optional = true }
tracy-client = { version = "0.17.4", optional = true }

[target."cfg(windows)".dependencies]
minhook-sys = "0.1.1"
Expand Down
16 changes: 15 additions & 1 deletion src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,21 @@ fn setup_logging_hooks() {

#[cfg(feature = "tracing-tracy")]
let tracy_layer = if env::var_os("BXT_RS_PROFILE_TRACY").is_some() {
Some(tracing_tracy::TracyLayer::new().with_formatter(only_message))
struct TracyLayerConfig<F>(F);

impl<F> tracing_tracy::Config for TracyLayerConfig<F>
where
F: for<'writer> tracing_subscriber::fmt::FormatFields<'writer> + 'static,
{
type Formatter = F;

fn formatter(&self) -> &Self::Formatter {
&self.0
}
}

let config = TracyLayerConfig(only_message);
Some(tracing_tracy::TracyLayer::new(config))
} else {
None
};
Expand Down

0 comments on commit ba34330

Please sign in to comment.