Skip to content

Commit 9f6ce15

Browse files
authored
Merge pull request #67 from eclipse-zenoh/feat/tracing
feat(tracing): using tracing and zenoh-util log init
2 parents d7b1ab6 + a33b9ed commit 9f6ce15

File tree

7 files changed

+84
-105
lines changed

7 files changed

+84
-105
lines changed

Cargo.lock

Lines changed: 31 additions & 55 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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,11 @@ async-trait = "0.1.66"
3131
base64 = "0.21.4"
3232
clap = "3.2.23"
3333
derivative = "2.2.0"
34-
env_logger = "0.10.0"
3534
flume = "0.10.14"
3635
futures = "0.3.26"
3736
git-version = "0.3.5"
3837
hex = "0.4.3"
3938
lazy_static = "1.4.0"
40-
log = "0.4.17"
4139
ntex = "0.7.17"
4240
ntex-mqtt = "0.12.16"
4341
ntex-tls = "0.3.2"
@@ -48,6 +46,7 @@ rustls-pemfile = "1.0.4"
4846
secrecy = { version = "0.8.0", features = ["serde", "alloc"] }
4947
serde = "1.0.154"
5048
serde_json = "1.0.94"
49+
tracing = "0.1"
5150
zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = [
5251
"unstable",
5352
] }
@@ -58,6 +57,7 @@ zenoh-ext = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/ze
5857
] }
5958
zenoh-plugin-rest = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false }
6059
zenoh-plugin-trait = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false }
60+
zenoh-util = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" }
6161

6262
[profile.release]
6363
debug = false

zenoh-bridge-mqtt/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ publish = false
2626
[dependencies]
2727
async-std = { workspace = true, features = ["unstable", "attributes"] }
2828
clap = { workspace = true }
29-
env_logger = { workspace = true }
3029
lazy_static = { workspace = true }
31-
log = { workspace = true }
30+
tracing = { workspace = true }
3231
serde_json = { workspace = true }
3332
zenoh = { workspace = true }
3433
zenoh-plugin-rest = { workspace = true }
3534
zenoh-plugin-trait = { workspace = true }
3635
zenoh-plugin-mqtt = { version = "0.11.0-dev", path = "../zenoh-plugin-mqtt/", default-features = false }
36+
zenoh-util = { workspace = true }
3737

3838
[[bin]]
3939
name = "zenoh-bridge-mqtt"

zenoh-bridge-mqtt/src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,9 @@ r#"--root-ca-certificate=[FILE] 'Path to the certificate of the certificate au
187187

188188
#[async_std::main]
189189
async fn main() {
190-
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("z=info")).init();
191-
log::info!(
190+
zenoh_util::init_log_from_env();
191+
192+
tracing::info!(
192193
"zenoh-bridge-mqtt {}",
193194
zenoh_plugin_mqtt::MqttPlugin::PLUGIN_LONG_VERSION
194195
);

0 commit comments

Comments
 (0)