From 8a1506206b4ff0fa3500a1c29b8908a64eb4449c Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Mon, 30 Oct 2023 16:47:18 +0100 Subject: [PATCH] sdk: Clean up logging in send_raw --- crates/matrix-sdk/src/room/mod.rs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/crates/matrix-sdk/src/room/mod.rs b/crates/matrix-sdk/src/room/mod.rs index e8b26e857..3c38b660c 100644 --- a/crates/matrix-sdk/src/room/mod.rs +++ b/crates/matrix-sdk/src/room/mod.rs @@ -1464,7 +1464,7 @@ impl Room { /// [`SyncMessageLikeEvent`]: ruma::events::SyncMessageLikeEvent /// [`StateUnsigned`]: ruma::events::StateUnsigned /// [`transaction_id`]: ruma::events::StateUnsigned#structfield.transaction_id - #[instrument(skip_all, fields(event_type, room_id = %self.room_id(), transaction_id, encrypted))] + #[instrument(skip_all, fields(event_type, room_id = ?self.room_id(), transaction_id, encrypted))] pub async fn send_raw( &self, content: serde_json::Value, @@ -1478,10 +1478,7 @@ impl Room { #[cfg(not(feature = "e2e-encryption"))] let content = { - debug!( - room_id = ?self.room_id(), - "Sending plaintext event to room because we don't have encryption support.", - ); + debug!("Sending plaintext event to room because we don't have encryption support."); Raw::new(&content)?.cast() }; @@ -1491,10 +1488,7 @@ impl Room { // Reactions are currently famously not encrypted, skip encrypting // them until they are. if event_type == "m.reaction" { - debug!( - room_id = ?self.room_id(), - "Sending plaintext event because the event type is {event_type}", - ); + debug!("Sending plaintext event because of the event type."); (Raw::new(&content)?.cast(), event_type) } else { debug!( @@ -1524,10 +1518,7 @@ impl Room { (encrypted_content.cast(), "m.room.encrypted") } } else { - debug!( - room_id = ?self.room_id(), - "Sending plaintext event because the room is NOT encrypted.", - ); + debug!("Sending plaintext event because the room is NOT encrypted.",); (Raw::new(&content)?.cast(), event_type) };