Skip to content

Commit da28114

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

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")]
@@ -2271,15 +2271,15 @@ impl Client {
22712271
}
22722272

22732273
loop {
2274-
debug!("Syncing");
2274+
trace!("Syncing");
22752275
let result = self.sync_loop_helper(&mut sync_settings).await;
22762276

2277-
debug!("Running callback");
2277+
trace!("Running callback");
22782278
if callback(result).await? == LoopCtrl::Break {
2279-
debug!("Callback told us to stop");
2279+
trace!("Callback told us to stop");
22802280
break;
22812281
}
2282-
debug!("Done running callback");
2282+
trace!("Done running callback");
22832283

22842284
Client::delay_sync(&mut last_sync_time).await
22852285
}

0 commit comments

Comments
 (0)