mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-18 00:01: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
|
|
@ -28,11 +28,11 @@ use ruma::{
|
|||
};
|
||||
use serde_json::value::to_raw_value;
|
||||
use tokio::sync::{mpsc, Mutex, RwLock};
|
||||
use tracing::warn;
|
||||
|
||||
use super::pdu::PduBuilder;
|
||||
use crate::{
|
||||
api::client_server::{leave_all_rooms, AUTO_GEN_PASSWORD_LENGTH},
|
||||
observability::prelude::*,
|
||||
services,
|
||||
utils::{self, dbg_truncate_str, room_version::RoomVersion},
|
||||
Error, PduEvent, Result,
|
||||
|
|
@ -289,7 +289,7 @@ impl Service {
|
|||
});
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self, grapevine_room))]
|
||||
#[t::instrument(skip(self, grapevine_room))]
|
||||
async fn handle_event(
|
||||
&self,
|
||||
event: AdminRoomEvent,
|
||||
|
|
@ -327,7 +327,7 @@ impl Service {
|
|||
.unwrap();
|
||||
}
|
||||
|
||||
#[tracing::instrument(
|
||||
#[t::instrument(
|
||||
skip(self, room_message),
|
||||
fields(
|
||||
room_message = dbg_truncate_str(&room_message, 50).as_ref(),
|
||||
|
|
@ -337,7 +337,7 @@ impl Service {
|
|||
self.sender.send(AdminRoomEvent::ProcessMessage(room_message)).unwrap();
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self, message_content))]
|
||||
#[t::instrument(skip(self, message_content))]
|
||||
pub(crate) fn send_message(
|
||||
&self,
|
||||
message_content: RoomMessageEventContent,
|
||||
|
|
@ -346,7 +346,7 @@ impl Service {
|
|||
}
|
||||
|
||||
// Parse and process a message from the admin room
|
||||
#[tracing::instrument(
|
||||
#[t::instrument(
|
||||
skip(self, room_message),
|
||||
fields(
|
||||
room_message = dbg_truncate_str(&room_message, 50).as_ref(),
|
||||
|
|
@ -397,7 +397,7 @@ impl Service {
|
|||
}
|
||||
|
||||
// Parse chat messages from the admin room into an AdminCommand object
|
||||
#[tracing::instrument(
|
||||
#[t::instrument(
|
||||
skip(command_line),
|
||||
fields(
|
||||
command_line = dbg_truncate_str(command_line, 50).as_ref(),
|
||||
|
|
@ -428,7 +428,7 @@ impl Service {
|
|||
}
|
||||
|
||||
#[allow(clippy::too_many_lines)]
|
||||
#[tracing::instrument(skip(self, body))]
|
||||
#[t::instrument(skip(self, body))]
|
||||
async fn process_admin_command(
|
||||
&self,
|
||||
command: AdminCommand,
|
||||
|
|
@ -1068,7 +1068,11 @@ impl Service {
|
|||
if leave_rooms {
|
||||
for &user_id in &user_ids {
|
||||
if let Err(error) = leave_all_rooms(user_id).await {
|
||||
warn!(%user_id, %error, "failed to leave one or more rooms");
|
||||
t::warn!(
|
||||
%user_id,
|
||||
%error,
|
||||
"failed to leave one or more rooms"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1253,7 +1257,7 @@ impl Service {
|
|||
}
|
||||
|
||||
// Utility to turn clap's `--help` text to HTML.
|
||||
#[tracing::instrument(skip_all)]
|
||||
#[t::instrument(skip_all)]
|
||||
fn usage_to_html(text: &str, server_name: &ServerName) -> String {
|
||||
// Replace `@grapevine:servername:-subcmdname` with
|
||||
// `@grapevine:servername: subcmdname`
|
||||
|
|
@ -1334,7 +1338,7 @@ impl Service {
|
|||
/// be used to issue admin commands by talking to the server user inside
|
||||
/// it.
|
||||
#[allow(clippy::too_many_lines)]
|
||||
#[tracing::instrument(skip(self))]
|
||||
#[t::instrument(skip(self))]
|
||||
pub(crate) async fn create_admin_room(&self) -> Result<()> {
|
||||
let room_id = RoomId::new(services().globals.server_name());
|
||||
|
||||
|
|
@ -1586,7 +1590,7 @@ impl Service {
|
|||
/// Invite the user to the grapevine admin room.
|
||||
///
|
||||
/// In grapevine, this is equivalent to granting admin privileges.
|
||||
#[tracing::instrument(skip(self))]
|
||||
#[t::instrument(skip(self))]
|
||||
pub(crate) async fn make_user_admin(
|
||||
&self,
|
||||
user_id: &UserId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue