Skip to content

Commit c6b66a3

Browse files
authored
Use tracing instead of log crate (eclipse-uprotocol#33)
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 c6b66a3

26 files changed

+299
-550
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: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,26 @@ license = false
2828
eula = false
2929

3030
[features]
31-
default = ["local"]
32-
local = ["up-rust/util"]
31+
default = []
3332
mqtt5 = ["dep:up-transport-mqtt5"]
3433
zenoh = ["dep:up-transport-zenoh", "dep:serde_json"]
3534

3635
[dependencies]
37-
clap = { version = "4.5", features = ["derive", "env"] }
38-
clap-num = { version = "1.2" }
39-
log = { workspace = true }
36+
clap = { version = "4.5.53", default-features = false, features = [
37+
"std",
38+
"derive",
39+
"env",
40+
"color",
41+
"help",
42+
"usage",
43+
"error-context",
44+
"suggestions",
45+
] }
4046
serde_json = { version = "1.0", optional = true }
4147
tokio = { workspace = true }
42-
up-rust = { workspace = true }
48+
tracing = { workspace = true }
49+
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }
50+
up-rust = { workspace = true, features = ["usubscription", "util" ] }
4351
up-subscription = { workspace = true }
4452
up-transport-mqtt5 = { version = "0.4.0", optional = true }
4553
up-transport-zenoh = { version = "0.9.0", optional = true }

0 commit comments

Comments
 (0)