sdk: Log the successful room message sending and record the received event ID

This commit is contained in:
Valere
2024-02-26 11:40:38 +01:00
committed by GitHub
parent 4f3cdfacaa
commit 30640ebb65
2 changed files with 6 additions and 2 deletions

View File

@@ -32,7 +32,7 @@ use ruma::{
serde::Raw,
OwnedTransactionId, TransactionId,
};
use tracing::{debug, Instrument, Span};
use tracing::{debug, info, Instrument, Span};
use super::Room;
use crate::{
@@ -201,6 +201,10 @@ impl<'a> IntoFuture for SendRawMessageLikeEvent<'a> {
);
let response = room.client.send(request, None).await?;
tracing::Span::current().record("event_id", tracing::field::debug(&response.event_id));
info!("Sent event in room");
Ok(response)
};

View File

@@ -1652,7 +1652,7 @@ impl Room {
/// }
/// # anyhow::Ok(()) };
/// ```
#[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, event_id))]
pub fn send_raw<'a>(
&'a self,
event_type: &'a str,