refactor: Import tracing macros instead of using qualified paths

This commit is contained in:
Jonas Platte 2023-01-26 13:10:52 +01:00 committed by Jonas Platte
parent c481caf060
commit 754453c135
3 changed files with 8 additions and 9 deletions

View File

@ -19,6 +19,7 @@ use matrix_sdk::{
},
Client as MatrixClient, Error, LoopCtrl,
};
use tracing::{debug, warn};
use super::{
room::Room, session_verification::SessionVerificationController, ClientState, RUNTIME,
@ -59,9 +60,7 @@ impl Client {
if let Some(session_verification_controller) = &*ctrl.clone().read().await {
session_verification_controller.process_to_device_message(ev).await;
} else {
tracing::debug!(
"received to-device message, but verification controller isn't ready"
);
debug!("received to-device message, but verification controller isn't ready");
}
}
});
@ -328,7 +327,7 @@ impl Client {
return LoopCtrl::Break;
}
tracing::warn!("Ignoring sync error: {sync_error:?}");
warn!("Ignoring sync error: {sync_error:?}");
LoopCtrl::Continue
}
}

View File

@ -7,7 +7,7 @@ use std::{ops::Deref, time::Duration};
use futures::executor::block_on;
use matrix_sdk::{ruma::events::room::message::RoomMessageEventContent, Client};
use tokio::sync::mpsc;
use tracing::warn;
use tracing::{error, info, warn};
use tuirealm::{
props::{Alignment, Borders, Color},
terminal::TerminalBridge,
@ -217,8 +217,8 @@ impl Update<Msg> for Model {
// fire and forget
match tl.send(RoomMessageEventContent::text_plain(m).into(), None).await
{
Ok(_r) => tracing::info!("Message send"),
Err(e) => tracing::error!("Sending message failed: {e}"),
Ok(_r) => info!("Message send"),
Err(e) => error!("Sending message failed: {e}"),
}
});
} else {

View File

@ -17,7 +17,7 @@ use matrix_sdk::{
};
use matrix_sdk_sled::make_store_config;
use sanitize_filename_reader_friendly::sanitize;
use tracing::{error, log};
use tracing::{error, info, log};
use tracing_flame::FlameLayer;
use tracing_subscriber::prelude::*;
use tuirealm::{application::PollStrategy, Event, Update};
@ -214,7 +214,7 @@ async fn main() -> Result<()> {
.map(|v| serde_json::from_slice(&v))
.transpose()?
{
tracing::info!("Restoring session from store");
info!("Restoring session from store");
client.restore_session(session).await?;
} else {
let theme = ColorfulTheme::default();