summaryrefslogtreecommitdiffstats
path: root/crates
diff options
context:
space:
mode:
authorMarcel Müller <m.mueller@ifm.com>2022-05-20 10:35:08 +0200
committerMatthias Beyer <matthias.beyer@ifm.com>2022-05-20 12:54:00 +0200
commita42bd5ad94527f7a30523ea78b440228127107b8 (patch)
tree2c2f08ae9cb4741b63d7814ea059d41ea1fbd00c /crates
parent43ed68145e7044c0d8f170af794d71c2fa93599a (diff)
Add tracing to send in tedge_api
Signed-off-by: Marcel Müller <m.mueller@ifm.com> Signed-off-by: Matthias Beyer <matthias.beyer@ifm.com> Reviewed-by: Matthias Beyer <matthias.beyer@ifm.com>
Diffstat (limited to 'crates')
-rw-r--r--crates/core/tedge_api/Cargo.toml1
-rw-r--r--crates/core/tedge_api/src/address.rs3
2 files changed, 4 insertions, 0 deletions
diff --git a/crates/core/tedge_api/Cargo.toml b/crates/core/tedge_api/Cargo.toml
index 619e769e..5546ed2b 100644
--- a/crates/core/tedge_api/Cargo.toml
+++ b/crates/core/tedge_api/Cargo.toml
@@ -20,6 +20,7 @@ termcolor = "1.1.3"
termimad = "0.20.1"
nu-ansi-term = "0.45.1"
tedge_config_derive = { version = "0.1.0", path = "tedge_config_derive" }
+tracing = "0.1"
[dev-dependencies]
pretty_assertions = "1.2.1"
diff --git a/crates/core/tedge_api/src/address.rs b/crates/core/tedge_api/src/address.rs
index 007be13f..5052d621 100644
--- a/crates/core/tedge_api/src/address.rs
+++ b/crates/core/tedge_api/src/address.rs
@@ -2,6 +2,7 @@ use std::{marker::PhantomData, sync::Arc, time::Duration};
use futures::future::BoxFuture;
use tokio::sync::RwLock;
+use tracing::{instrument, trace};
use crate::{
message::MessageType,
@@ -48,8 +49,10 @@ impl InnerMessageSender {
Self { send_provider }
}
+ #[instrument(skip_all, level = "trace")]
async fn send(&self, message: InternalMessage) -> Result<(), InternalMessage> {
let lock = self.send_provider.read().await;
+ trace!(sender_exists = ?lock.is_some(), "Checking for internal sender");
if let Some(sender) = &*lock {
let sender = (*sender)(message, ShouldWait::Wait);