From b19d2ad5b01f287ec152fd1ffad67bdc095b820e Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 27 Apr 2024 12:58:56 -0700 Subject: [PATCH] daily logging improvements Signed-off-by: Jason Volk --- src/service/rooms/auth_chain/mod.rs | 1 + src/service/rooms/typing/mod.rs | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/service/rooms/auth_chain/mod.rs b/src/service/rooms/auth_chain/mod.rs index 9a61e4ea..10c52d02 100644 --- a/src/service/rooms/auth_chain/mod.rs +++ b/src/service/rooms/auth_chain/mod.rs @@ -30,6 +30,7 @@ impl Service { .filter_map(move |sid| services().rooms.short.get_eventid_from_short(sid).ok())) } + #[tracing::instrument(skip_all)] pub(crate) async fn get_auth_chain(&self, room_id: &RoomId, starting_events: &[&EventId]) -> Result> { const NUM_BUCKETS: usize = 50; //TODO: change possible w/o disrupting db? const BUCKET: BTreeSet<(u64, &EventId)> = BTreeSet::new(); diff --git a/src/service/rooms/typing/mod.rs b/src/service/rooms/typing/mod.rs index 3434c55a..61a226fc 100644 --- a/src/service/rooms/typing/mod.rs +++ b/src/service/rooms/typing/mod.rs @@ -6,10 +6,9 @@ use ruma::{ OwnedRoomId, OwnedUserId, RoomId, UserId, }; use tokio::sync::{broadcast, RwLock}; -use tracing::debug; use crate::{ - services, + debug_info, services, utils::{self, user_id::user_is_local}, Result, }; @@ -26,7 +25,7 @@ impl Service { /// Sets a user as typing until the timeout timestamp is reached or /// roomtyping_remove is called. pub(crate) async fn typing_add(&self, user_id: &UserId, room_id: &RoomId, timeout: u64) -> Result<()> { - debug!("typing add {:?} in {:?} timeout:{:?}", user_id, room_id, timeout); + debug_info!("typing started {:?} in {:?} timeout:{:?}", user_id, room_id, timeout); // update clients self.typing .write() @@ -50,7 +49,7 @@ impl Service { /// Removes a user from typing before the timeout is reached. pub(crate) async fn typing_remove(&self, user_id: &UserId, room_id: &RoomId) -> Result<()> { - debug!("typing remove {:?} in {:?}", user_id, room_id); + debug_info!("typing stopped {:?} in {:?}", user_id, room_id); // update clients self.typing .write() @@ -107,7 +106,7 @@ impl Service { let typing = &mut self.typing.write().await; let room = typing.entry(room_id.to_owned()).or_default(); for user in &removable { - debug!("typing maintain remove {:?} in {:?}", &user, room_id); + debug_info!("typing timeout {:?} in {:?}", &user, room_id); room.remove(user); } // update clients