mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-04-29 03:23:50 -04:00
sdk: Log the successful room message sending and record the received event ID
This commit is contained in:
@@ -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)
|
||||
};
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user