Skip to content

Commit 440cdf3

Browse files
committed
Add tracing_chrome crate by copy-pasting file
The file was taken unmodified from the following link, except for file attributes at the top: https://github.com/thoren-d/tracing-chrome/blob/7e2625ab4aeeef2f0ef9bde9d6258dd181c04472/src/lib.rs Depending on the tracing-chrome crate from crates.io is unfortunately not possible since it depends on `tracing_core` which conflicts with rustc_private's `tracing_core` (meaning it would not be possible to use the [ChromeLayer] in a context that expects a [Layer] from from rustc_private's `tracing_core` version)
1 parent 1c08c5c commit 440cdf3

File tree

6 files changed

+634
-1
lines changed

6 files changed

+634
-1
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ chrono = { version = "0.4.38", default-features = false }
2727
chrono-tz = "0.10"
2828
directories = "6"
2929
bitflags = "2.6"
30+
serde_json = { version = "1.0", optional = true }
3031

3132
# Copied from `compiler/rustc/Cargo.toml`.
3233
# But only for some targets, it fails for others. Rustc configures this in its CI, but we can't
@@ -66,7 +67,7 @@ default = ["stack-cache"]
6667
genmc = []
6768
stack-cache = []
6869
stack-cache-consistency-check = ["stack-cache"]
69-
tracing = []
70+
tracing = ["serde_json"]
7071

7172
[lints.rust.unexpected_cfgs]
7273
level = "warn"

rustfmt.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ imports_granularity = "Module"
88
force_multiline_blocks = true
99
match_arm_blocks = false
1010
match_arm_leading_pipes = "Preserve"
11+
12+
ignore = [
13+
# this file is copy-pasted from the tracing_chrome crate and should remain like the original
14+
"src/trace/tracing_chrome.rs"
15+
]

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ mod operator;
8888
mod provenance_gc;
8989
mod range_map;
9090
mod shims;
91+
mod trace;
9192

9293
// Establish a "crate-wide prelude": we often import `crate::*`.
9394
// Make all those symbols available in the same place as our own.

src/trace/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mod tracing_chrome;

0 commit comments

Comments
 (0)