Skip to content

Commit 1fb5db1

Browse files
committed
tracing macro
1 parent be234fd commit 1fb5db1

File tree

6 files changed

+39
-43
lines changed

6 files changed

+39
-43
lines changed

Cargo.lock

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

crates/rpc/Cargo.toml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,26 @@ version.workspace = true
1515
workspace = true
1616

1717
[dependencies]
18-
anyhow = { workspace = true }
19-
futures = { version = "0.3" }
20-
http = { workspace = true }
21-
mediatype = { version = "0.21" }
22-
miden-node-proto = { workspace = true }
23-
miden-node-proto-build = { workspace = true }
24-
miden-node-tracing = { workspace = true }
25-
miden-node-utils = { workspace = true }
26-
miden-protocol = { default-features = true, workspace = true }
27-
miden-tx = { default-features = true, workspace = true }
28-
semver = { version = "1.0" }
29-
thiserror = { workspace = true }
30-
tokio = { features = ["macros", "net", "rt-multi-thread"], workspace = true }
31-
tokio-stream = { features = ["net"], workspace = true }
32-
tonic = { default-features = true, features = ["tls-native-roots", "tls-ring"], workspace = true }
33-
tonic-reflection = { workspace = true }
34-
tonic-web = { version = "0.14" }
35-
tower = { workspace = true }
36-
tower-http = { features = ["trace"], workspace = true }
37-
tracing = { workspace = true }
38-
url = { workspace = true }
18+
anyhow = { workspace = true }
19+
futures = { version = "0.3" }
20+
http = { workspace = true }
21+
mediatype = { version = "0.21" }
22+
miden-node-proto = { workspace = true }
23+
miden-node-proto-build = { workspace = true }
24+
miden-node-utils = { workspace = true }
25+
miden-protocol = { default-features = true, workspace = true }
26+
miden-tx = { default-features = true, workspace = true }
27+
semver = { version = "1.0" }
28+
thiserror = { workspace = true }
29+
tokio = { features = ["macros", "net", "rt-multi-thread"], workspace = true }
30+
tokio-stream = { features = ["net"], workspace = true }
31+
tonic = { default-features = true, features = ["tls-native-roots", "tls-ring"], workspace = true }
32+
tonic-reflection = { workspace = true }
33+
tonic-web = { version = "0.14" }
34+
tower = { workspace = true }
35+
tower-http = { features = ["trace"], workspace = true }
36+
tracing = { workspace = true }
37+
url = { workspace = true }
3938

4039
[dev-dependencies]
4140
miden-air = { features = ["testing"], workspace = true }

crates/store/Cargo.toml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ version.workspace = true
1515
workspace = true
1616

1717
[dependencies]
18-
anyhow = { workspace = true }
19-
deadpool = { default-features = false, features = ["managed", "rt_tokio_1"], version = "0.12" }
20-
deadpool-diesel = { features = ["sqlite"], version = "0.6" }
21-
deadpool-sync = { version = "0.1" }
22-
diesel = { features = ["numeric", "sqlite"], version = "2.3" }
23-
diesel_migrations = { features = ["sqlite"], version = "2.3" }
24-
fs-err = { workspace = true }
25-
hex = { version = "0.4" }
26-
indexmap = { workspace = true }
27-
miden-node-proto = { workspace = true }
28-
miden-node-proto-build = { features = ["internal"], workspace = true }
29-
miden-node-tracing = { workspace = true }
30-
miden-node-utils = { workspace = true }
31-
miden-standards = { workspace = true }
18+
anyhow = { workspace = true }
19+
deadpool = { default-features = false, features = ["managed", "rt_tokio_1"], version = "0.12" }
20+
deadpool-diesel = { features = ["sqlite"], version = "0.6" }
21+
deadpool-sync = { version = "0.1" }
22+
diesel = { features = ["numeric", "sqlite"], version = "2.3" }
23+
diesel_migrations = { features = ["sqlite"], version = "2.3" }
24+
fs-err = { workspace = true }
25+
hex = { version = "0.4" }
26+
indexmap = { workspace = true }
27+
miden-node-proto = { workspace = true }
28+
miden-node-proto-build = { features = ["internal"], workspace = true }
29+
miden-node-tracing = { workspace = true }
30+
miden-node-utils = { workspace = true }
31+
miden-standards = { workspace = true }
3232
# TODO remove `testing` from `miden-protocol`, required for `BlockProof::new_dummy`
3333
miden-protocol = { features = ["std", "testing"], workspace = true }
3434
pretty_assertions = { workspace = true }

crates/tracing-macro/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ proc-macro = true
2020
[dependencies]
2121
proc-macro2 = "1.0"
2222
quote = "1.0"
23-
syn = { features = ["full", "extra-traits", "parsing"], version = "2.0" }
23+
syn = { features = ["extra-traits", "full", "parsing"], version = "2.0" }

crates/tracing-macro/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub fn instrument_with_err_report(attr: TokenStream, item: TokenStream) -> Token
7575
};
7676

7777
if has_err && returns_result {
78-
generate_with_error_reporting(attr2, input).into()
78+
generate_with_error_reporting(&attr2, input).into()
7979
} else {
8080
// Just delegate to standard tracing::instrument
8181
let ItemFn { attrs, vis, sig, block } = input;
@@ -89,12 +89,12 @@ pub fn instrument_with_err_report(attr: TokenStream, item: TokenStream) -> Token
8989
}
9090
}
9191

92-
fn generate_with_error_reporting(attr: TokenStream2, input: ItemFn) -> TokenStream2 {
92+
fn generate_with_error_reporting(attr: &TokenStream2, input: ItemFn) -> TokenStream2 {
9393
let ItemFn { attrs, vis, sig, block } = input;
9494

9595
// Remove 'err' from the attributes we pass to tracing::instrument
9696
// since we handle error reporting ourselves
97-
let tracing_attr = remove_err_from_attr(&attr);
97+
let tracing_attr = remove_err_from_attr(attr);
9898

9999
// Get the return type for type annotation
100100
let result_type = match &sig.output {

crates/tracing/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ workspace = true
1717
[dependencies]
1818
miden-node-tracing-macro = { workspace = true }
1919
miden-node-utils = { workspace = true }
20-
tracing = { workspace = true }
21-
tracing-opentelemetry = { version = "0.32" }
2220
opentelemetry = { version = "0.31" }
21+
tracing = { workspace = true }

0 commit comments

Comments
 (0)