Skip to content

Commit d0f3ddd

Browse files
committed
Use tracing instead of log crate
Changed usubscription library to use generic tracing framework instead of depending on env_logger crate. This allows users of the library to choose their own logging backend. Also updated up-subscription-cli to use tracing_subscriber as logging backend and set up logging accordingly. Removed obsolete None transport and related code and improved command line argument handling for transport selection in up-subscription-cli.
1 parent d5944a7 commit d0f3ddd

25 files changed

+318
-541
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@ version = "0.4.0"
3030

3131
[workspace.dependencies]
3232
async-trait = { version = "0.1" }
33-
env_logger = { version = "0.11" }
34-
log = { version = "0.4" }
3533
mockall = { version = "0.14" }
3634
protobuf = { version = "3.7.2" }
3735
test-case = { version = "3.3" }
3836
tokio = { version = "1", features = ["full"] }
37+
tracing = { version = "0.1", default-features = false, features = ["log", "std"] }
3938
up-rust = { version = "0.9.0", features = ["usubscription"] }
4039
up-subscription = { path = "./up-subscription" }
4140

up-subscription-cli/Cargo.toml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,20 @@ mqtt5 = ["dep:up-transport-mqtt5"]
3434
zenoh = ["dep:up-transport-zenoh", "dep:serde_json"]
3535

3636
[dependencies]
37-
clap = { version = "4.5", features = ["derive", "env"] }
38-
clap-num = { version = "1.2" }
39-
log = { workspace = true }
37+
clap = { version = "4.5.53", default-features = false, features = [
38+
"std",
39+
"derive",
40+
"env",
41+
"color",
42+
"help",
43+
"usage",
44+
"error-context",
45+
"suggestions",
46+
] }
4047
serde_json = { version = "1.0", optional = true }
4148
tokio = { workspace = true }
49+
tracing = { workspace = true }
50+
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
4251
up-rust = { workspace = true }
4352
up-subscription = { workspace = true }
4453
up-transport-mqtt5 = { version = "0.4.0", optional = true }

0 commit comments

Comments
 (0)