Skip to content

Commit bef9243

Browse files
committed
fixup! feat(sdk): Add a root span to our client
1 parent b0bad5b commit bef9243

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

crates/matrix-sdk/src/client/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ impl ClientBuilder {
341341
/// server discovery request is made which can fail; if you didn't set
342342
/// [`server_versions(false)`][Self::server_versions], that amounts to
343343
/// another request that can fail
344-
#[instrument(skip_all, parent = &self.root_span, target = "matrix_sdk::client", fields(homeserver))]
344+
#[instrument(skip_all, parent = &self.root_span, target = "matrix_sdk::client", fields(homeserver))]
345345
pub async fn build(self) -> Result<Client, ClientBuildError> {
346346
debug!("Starting to build the Client");
347347

crates/matrix-sdk/src/client/login_builder.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,13 @@ where
279279
///
280280
/// Instead of calling this function and `.await`ing its return value, you
281281
/// can also `.await` the `SsoLoginBuilder` directly.
282-
#[instrument(target = "matrix_sdk::client", name = "login", skip_all, fields(method = "sso"))]
282+
#[instrument(
283+
parent = &self.client.root_span,
284+
target = "matrix_sdk::client",
285+
name = "login",
286+
skip_all,
287+
fields(method = "sso"),
288+
)]
283289
pub async fn send(self) -> Result<login::v3::Response> {
284290
use std::{
285291
convert::Infallible,

crates/matrix-sdk/src/client/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ use serde::de::DeserializeOwned;
6969
use tokio::sync::OnceCell;
7070
#[cfg(feature = "e2e-encryption")]
7171
use tracing::error;
72-
use tracing::{debug, field::display, info, instrument, Instrument, Span};
72+
use tracing::{debug, field::display, info, instrument, trace, Instrument, Span};
7373
use url::Url;
7474

7575
#[cfg(feature = "e2e-encryption")]
@@ -2281,15 +2281,15 @@ impl Client {
22812281
}
22822282

22832283
loop {
2284-
debug!("Syncing");
2284+
trace!("Syncing");
22852285
let result = self.sync_loop_helper(&mut sync_settings).await;
22862286

2287-
debug!("Running callback");
2287+
trace!("Running callback");
22882288
if callback(result).await? == LoopCtrl::Break {
2289-
debug!("Callback told us to stop");
2289+
trace!("Callback told us to stop");
22902290
break;
22912291
}
2292-
debug!("Done running callback");
2292+
trace!("Done running callback");
22932293

22942294
Client::delay_sync(&mut last_sync_time).await
22952295
}

0 commit comments

Comments
 (0)