diff --git a/Cargo.lock b/Cargo.lock index ecb66a4..a431aee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,54 +124,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anstream" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" - -[[package]] -name = "anstyle-parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" -dependencies = [ - "windows-sys 0.48.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - [[package]] name = "anyhow" version = "1.0.75" @@ -536,12 +488,6 @@ dependencies = [ "inout", ] -[[package]] -name = "colorchoice" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" - [[package]] name = "concurrent-queue" version = "2.2.0" @@ -849,29 +795,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "env_filter" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" -dependencies = [ - "log", - "regex", -] - -[[package]] -name = "env_logger" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" -dependencies = [ - "anstream", - "anstyle", - "env_filter", - "humantime", - "log", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -1654,9 +1577,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" dependencies = [ "value-bag", ] @@ -3547,12 +3470,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "utf8parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - [[package]] name = "uuid" version = "1.4.1" @@ -3594,9 +3511,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.8.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74797339c3b98616c009c7c3eb53a0ce41e85c8ec66bd3db96ed132d20cfdee8" +checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" [[package]] name = "vec_map" @@ -3936,7 +3853,7 @@ dependencies = [ [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "async-trait", "base64 0.21.4", @@ -3989,15 +3906,14 @@ dependencies = [ "async-std", "async-trait", "base64 0.21.4", - "env_logger", "git-version", "humantime", "influxdb", "lazy_static", - "log", "rustc_version 0.4.0", "serde", "serde_json", + "tracing", "uuid", "zenoh", "zenoh-collections", @@ -4015,19 +3931,18 @@ dependencies = [ "async-trait", "base64 0.21.4", "chrono", - "env_logger", "futures", "git-version", "influxdb2", "influxdb2-derive", "influxdb2-structmap", "lazy_static", - "log", "num-traits", "rand 0.8.5", "rustc_version 0.4.0", "serde", "serde_json", + "tracing", "uuid", "zenoh", "zenoh-collections", @@ -4040,7 +3955,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "zenoh-collections", ] @@ -4048,7 +3963,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "serde", "tracing", @@ -4060,12 +3975,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "flume", "json5", @@ -4085,7 +4000,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "async-global-executor", "lazy_static", @@ -4097,7 +4012,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "aes 0.8.3", "hmac 0.12.1", @@ -4110,7 +4025,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -4124,7 +4039,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "async-trait", "zenoh-config", @@ -4142,7 +4057,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "async-trait", "flume", @@ -4165,7 +4080,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "async-trait", "base64 0.21.4", @@ -4193,7 +4108,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "async-trait", "tokio", @@ -4211,7 +4126,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "async-trait", "base64 0.21.4", @@ -4239,7 +4154,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "async-trait", "socket2 0.5.6", @@ -4260,7 +4175,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "async-trait", "futures", @@ -4280,7 +4195,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "async-trait", "futures-util", @@ -4301,7 +4216,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "proc-macro2", "quote", @@ -4312,7 +4227,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "const_format", "libloading", @@ -4328,7 +4243,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "const_format", "rand 0.8.5", @@ -4342,7 +4257,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "anyhow", ] @@ -4350,7 +4265,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "futures", "lazy_static", @@ -4362,7 +4277,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "event-listener 4.0.0", "futures", @@ -4376,7 +4291,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "futures", "tokio", @@ -4389,7 +4304,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "async-trait", "flume", @@ -4421,7 +4336,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "async-std", "async-trait", @@ -4444,7 +4359,7 @@ dependencies = [ [[package]] name = "zenoh_backend_traits" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3537ee657358a1e269d8a7f5e74afc22af161aae" dependencies = [ "async-std", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index d1568e1..5a2c155 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,12 +38,11 @@ description = "Backend for Zenoh using InfluxDB" async-std = "1.12.0" async-trait = "0.1.66" base64 = "0.21.0" -env_logger = "0.11.0" git-version = "0.3.5" lazy_static = "1.4.0" -log = "0.4.17" serde = { version = "1.0.154", features = ["derive"] } serde_json = "1.0.94" +tracing = "0.1" uuid = { version = "1.3.0", features = ["v4"] } zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = ["unstable"] } diff --git a/v1/Cargo.toml b/v1/Cargo.toml index bd3ee33..cd55508 100644 --- a/v1/Cargo.toml +++ b/v1/Cargo.toml @@ -23,14 +23,13 @@ stats = ["zenoh/stats"] async-std = { workspace = true } async-trait = { workspace = true } base64 = { workspace = true } -env_logger = { workspace = true } git-version = { workspace = true } humantime = "2.1.0" influxdb = { version = "0.7.1", default-features = false, features = ["derive", "use-serde", "h1-client-rustls"] } lazy_static = { workspace = true } -log = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } +tracing = { workspace = true } uuid = { workspace = true } zenoh = { workspace = true } zenoh_backend_traits = { workspace = true } diff --git a/v1/src/lib.rs b/v1/src/lib.rs index 51df3b0..d938a81 100644 --- a/v1/src/lib.rs +++ b/v1/src/lib.rs @@ -18,12 +18,12 @@ use base64::{engine::general_purpose::STANDARD as b64_std_engine, Engine}; use influxdb::{ Client, ReadQuery as InfluxRQuery, Timestamp as InfluxTimestamp, WriteQuery as InfluxWQuery, }; -use log::{debug, error, warn}; use serde::Deserialize; use std::convert::{TryFrom, TryInto}; use std::str::FromStr; use std::sync::Arc; use std::time::{Duration, Instant}; +use tracing::{debug, error, warn}; use uuid::Uuid; use zenoh::buffers::{buffer::SplitBuffer, ZBuf}; use zenoh::prelude::*; @@ -70,7 +70,7 @@ fn get_private_conf<'a>( PrivacyGetResult::NotFound => Ok(None), PrivacyGetResult::Private(serde_json::Value::String(v)) => Ok(Some(v)), PrivacyGetResult::Public(serde_json::Value::String(v)) => { - log::warn!( + tracing::warn!( r#"Value "{}" is given for `{}` publicly (i.e. is visible by anyone who can fetch the router configuration). You may want to replace `{}: "{}"` with `private: {{{}: "{}"}}`"#, v, credit, @@ -85,7 +85,7 @@ fn get_private_conf<'a>( public: serde_json::Value::String(public), private: serde_json::Value::String(private), } => { - log::warn!( + tracing::warn!( r#"Value "{}" is given for `{}` publicly, but a private value also exists. The private value will be used, but the public value, which is {} the same as the private one, will still be visible in configurations."#, public, credit, @@ -111,9 +111,8 @@ impl Plugin for InfluxDbBackend { const PLUGIN_LONG_VERSION: &'static str = plugin_long_version!(); fn start(_name: &str, config: &Self::StartArgs) -> ZResult { - // For some reasons env_logger is sometime not active in a loaded library. - // Try to activate it here, ignoring failures. - let _ = env_logger::try_init(); + zenoh_util::init_log_from_env(); + debug!("InfluxDB backend {}", Self::PLUGIN_VERSION); let mut config = config.clone(); diff --git a/v2/Cargo.toml b/v2/Cargo.toml index 5937f24..c00a184 100644 --- a/v2/Cargo.toml +++ b/v2/Cargo.toml @@ -24,7 +24,6 @@ async-std = { workspace = true } async-trait = { workspace = true } base64 = { workspace = true } chrono = { version = "0.4.31", features = ["serde"] } -env_logger = { workspace = true } futures = "0.3.28" git-version = { workspace = true } influxdb2 = { version = "0.4.5", features = [ @@ -33,11 +32,11 @@ influxdb2 = { version = "0.4.5", features = [ influxdb2-derive = "0.1.1" influxdb2-structmap = "0.2" lazy_static = { workspace = true } -log = { workspace = true } num-traits = "0.2" rand = "0.8.5" serde = { workspace = true } serde_json = { workspace = true } +tracing = { workspace = true } uuid = { workspace = true } zenoh = { workspace = true } zenoh_backend_traits = { workspace = true } diff --git a/v2/src/lib.rs b/v2/src/lib.rs index ef0beac..30dca03 100644 --- a/v2/src/lib.rs +++ b/v2/src/lib.rs @@ -71,7 +71,7 @@ fn get_private_conf<'a>(config: Config<'a>, credit: &str) -> ZResult Ok(None), PrivacyGetResult::Private(serde_json::Value::String(v)) => Ok(Some(v)), PrivacyGetResult::Public(serde_json::Value::String(v)) => { - log::warn!( + tracing::warn!( r#"Value "{}" is given for `{}` publicly (i.e. is visible by anyone who can fetch the router configuration). You may want to replace `{}: "{}"` with `private: {{{}: "{}"}}`"#, v, @@ -87,7 +87,7 @@ fn get_private_conf<'a>(config: Config<'a>, credit: &str) -> ZResult { - log::warn!( + tracing::warn!( r#"Value "{}" is given for `{}` publicly, but a private value also exists. The private value will be used, but the public value, which is {} the same as the private one, will still be visible in configurations."#, @@ -117,7 +117,7 @@ fn extract_credentials(config: Config) -> ZResult> { token: token.clone(), })), _ => { - log::error!("Couldn't get token and org"); + tracing::error!("Couldn't get token and org"); bail!( "Properties `{}` and `{}` must exist", PROP_BACKEND_ORG_ID, @@ -139,10 +139,9 @@ impl Plugin for InfluxDbBackend { const PLUGIN_LONG_VERSION: &'static str = plugin_long_version!(); fn start(_name: &str, config: &Self::StartArgs) -> ZResult { - // For some reasons env_logger is sometime not active in a loaded library. - // Try to activate it here, ignoring failures. - let _ = env_logger::try_init(); - log::debug!("InfluxDBv2 backend {}", Self::PLUGIN_VERSION); + zenoh_util::init_log_from_env(); + + tracing::debug!("InfluxDBv2 backend {}", Self::PLUGIN_VERSION); let mut config = config.clone(); config @@ -400,7 +399,7 @@ impl InfluxDbStorage { query_result = result; } Err(e) => { - log::error!( + tracing::error!( "Couldn't get data from InfluxDBv2 database {} with error: {} ", db, e @@ -464,7 +463,7 @@ impl Storage for InfluxDbStorage { if let Some(del_time) = self.get_deletion_timestamp(measurement.as_str()).await? { // ignore sample if oldest than the deletion if timestamp < del_time { - log::debug!( + tracing::debug!( "Received a value for {:?} with timestamp older than its deletion in InfluxDBv2 database; Ignore it", measurement ); @@ -526,7 +525,7 @@ impl Storage for InfluxDbStorage { .expect("Couldn't convert uhlc timestamp to naivedatetime"); let predicate = None; //can be specified with tag or field values - log::debug!( + tracing::debug!( "Delete {:?} with Influx query in InfluxDBv2 storage", measurement ); @@ -555,7 +554,7 @@ impl Storage for InfluxDbStorage { .timestamp(influx_time) //converted timestamp to i64 .build()?]; - log::debug!( + tracing::debug!( "Mark measurement {} as deleted at time {} in InfluxDBv2 storage", measurement.clone(), stop_timestamp @@ -626,7 +625,7 @@ impl Storage for InfluxDbStorage { } } - log::debug!( + tracing::debug!( "Get {:?} with Influx query:{} in InfluxDBv2 storage", key, qs @@ -642,7 +641,7 @@ impl Storage for InfluxDbStorage { query_result = result; } Err(e) => { - log::error!( + tracing::error!( "Couldn't get data from database {} in InfluxDBv2 storage with error: {} ", db, e @@ -676,7 +675,7 @@ impl Storage for InfluxDbStorage { match b64_std_engine.decode(zpoint.value) { Ok(v) => ZBuf::from(v), Err(e) => { - log::warn!( + tracing::warn!( r#"Failed to decode zenoh base64 Value from Influx point with timestamp="{}": {}"#, zpoint.timestamp, e @@ -691,7 +690,7 @@ impl Storage for InfluxDbStorage { let timestamp = match Timestamp::from_str(&zpoint.timestamp) { Ok(t) => t, Err(e) => { - log::warn!( + tracing::warn!( r#"Failed to decode zenoh Timestamp from Influx point with timestamp="{}": {:?}"#, zpoint.timestamp, e @@ -707,7 +706,7 @@ impl Storage for InfluxDbStorage { //putting a stub here to be implemented later async fn get_all_entries(&self) -> ZResult, Timestamp)>> { - log::warn!("called get_all_entries in InfluxDBv2 storage"); + tracing::warn!("called get_all_entries in InfluxDBv2 storage"); let mut result: Vec<(Option, Timestamp)> = Vec::new(); let curr_time = zenoh::time::new_reception_timestamp(); result.push((None, curr_time)); @@ -725,11 +724,11 @@ fn get_db_name(config: StorageConfig) -> ZResult { impl Drop for InfluxDbStorage { fn drop(&mut self) { - log::debug!("Closing InfluxDBv2 storage"); + tracing::debug!("Closing InfluxDBv2 storage"); let db = match self.config.volume_cfg.get(PROP_STORAGE_DB) { Some(serde_json::Value::String(s)) => s.to_string(), _ => { - log::error!("no db was found"); + tracing::error!("no db was found"); return; } }; @@ -737,22 +736,22 @@ impl Drop for InfluxDbStorage { match self.on_closure { OnClosure::DropDb => { task::block_on(async move { - log::debug!("Close InfluxDBv2 storage, dropping database {}", db); + tracing::debug!("Close InfluxDBv2 storage, dropping database {}", db); if let Err(e) = self.admin_client.delete_bucket(&db).await { - log::error!("Failed to drop InfluxDbv2 database '{}' : {}", db, e) + tracing::error!("Failed to drop InfluxDbv2 database '{}' : {}", db, e) } }); } OnClosure::DropSeries => { task::block_on(async move { - log::debug!( + tracing::debug!( "Close InfluxDBv2 storage, dropping all series from database {}", db ); let start = NaiveDateTime::MIN; let stop = NaiveDateTime::MAX; if let Err(e) = self.client.delete(&db, start, stop, None).await { - log::error!( + tracing::error!( "Failed to drop all series from InfluxDbv2 database '{}' : {}", db, e @@ -761,7 +760,7 @@ impl Drop for InfluxDbStorage { }); } OnClosure::DoNothing => { - log::debug!("Close InfluxDBv2 storage, keeping database {} as it is", db); + tracing::debug!("Close InfluxDBv2 storage, keeping database {} as it is", db); } } }