mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-19 16:51:24 +01:00
switch all tracing imports to observability::prelude
This commit is contained in:
parent
bc5f31b3a2
commit
5fca67054e
63 changed files with 824 additions and 735 deletions
|
|
@ -26,10 +26,10 @@ use ruma::{
|
|||
},
|
||||
uint, ServerName, UInt,
|
||||
};
|
||||
use tracing::{error, info, warn};
|
||||
|
||||
use crate::{
|
||||
service::rooms::state::ExtractType, services, Ar, Error, Ra, Result,
|
||||
observability::prelude::*, service::rooms::state::ExtractType, services,
|
||||
Ar, Error, Ra, Result,
|
||||
};
|
||||
|
||||
/// # `POST /_matrix/client/r0/publicRooms`
|
||||
|
|
@ -94,7 +94,7 @@ pub(crate) async fn set_room_visibility_route(
|
|||
match &body.visibility {
|
||||
room::Visibility::Public => {
|
||||
services().rooms.directory.set_public(&body.room_id)?;
|
||||
info!(
|
||||
t::info!(
|
||||
user_id = %sender_user,
|
||||
room_id = %body.room_id,
|
||||
"User made room public",
|
||||
|
|
@ -269,7 +269,7 @@ pub(crate) async fn get_public_rooms_filtered_helper(
|
|||
}
|
||||
|
||||
#[allow(clippy::too_many_lines)]
|
||||
#[tracing::instrument]
|
||||
#[t::instrument]
|
||||
fn room_id_to_chunk(room_id: ruma::OwnedRoomId) -> Result<PublicRoomsChunk> {
|
||||
let canonical_alias = services()
|
||||
.rooms
|
||||
|
|
@ -292,7 +292,7 @@ fn room_id_to_chunk(room_id: ruma::OwnedRoomId) -> Result<PublicRoomsChunk> {
|
|||
.state_cache
|
||||
.room_joined_count(&room_id)?
|
||||
.unwrap_or_else(|| {
|
||||
warn!("Room has no member count");
|
||||
t::warn!("Room has no member count");
|
||||
0
|
||||
})
|
||||
.try_into()
|
||||
|
|
@ -306,7 +306,7 @@ fn room_id_to_chunk(room_id: ruma::OwnedRoomId) -> Result<PublicRoomsChunk> {
|
|||
serde_json::from_str(s.content.get())
|
||||
.map(|c: RoomTopicEventContent| Some(c.topic))
|
||||
.map_err(|_| {
|
||||
error!("Invalid room topic event in database for room",);
|
||||
t::error!("Invalid room topic event in database for room",);
|
||||
Error::bad_database("Invalid room topic event in database.")
|
||||
})
|
||||
})?;
|
||||
|
|
@ -371,7 +371,10 @@ fn room_id_to_chunk(room_id: ruma::OwnedRoomId) -> Result<PublicRoomsChunk> {
|
|||
_ => None,
|
||||
})
|
||||
.map_err(|error| {
|
||||
error!(%error, "Invalid room join rule event in database");
|
||||
t::error!(
|
||||
%error,
|
||||
"Invalid room join rule event in database"
|
||||
);
|
||||
Error::BadDatabase(
|
||||
"Invalid room join rule event in database.",
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue