Skip to content

Commit f1ce0d4

Browse files
Merge pull request #7 from tracel-ai/feat/add-tracing
Feat/add tracing
2 parents 98c0bd3 + ac36952 commit f1ce0d4

File tree

5 files changed

+29
-8
lines changed

5 files changed

+29
-8
lines changed

Cargo.lock

Lines changed: 15 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ members = ["burn-central-client", "xtask"]
77

88
[workspace.package]
99
edition = "2024"
10-
version = "0.3.1"
10+
version = "0.3.2"
1111
authors = ["Burn central team"]
1212
homepage = "https://burn.dev"
1313
repository = "https://github.com/tracel-ai/burn-central-client"
@@ -21,6 +21,7 @@ uuid = { version = "1.18.1" }
2121
thiserror = { version = "2.0.17" }
2222
strum = { version = "0.27.2", features = ["derive"] }
2323
tungstenite = { version = "0.26.2", features = ["native-tls"] }
24+
tracing = { version = "0.1" }
2425

2526
[profile.dev]
2627
debug = 0

burn-central-client/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ uuid.workspace = true
1616
serde_json.workspace = true
1717
thiserror.workspace = true
1818
strum.workspace = true
19-
tungstenite.workspace = true
19+
tungstenite.workspace = true
20+
tracing.workspace = true

burn-central-client/src/client.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,12 @@ impl Client {
174174
}
175175
request_builder = request_builder.header("X-SDK-Version", env!("CARGO_PKG_VERSION"));
176176

177+
tracing::debug!("Sending request to Burn Central: {:?}", request_builder);
178+
177179
let response = request_builder.send()?.map_to_burn_central_err()?;
178180

181+
tracing::debug!("Received response from Burn Central: {:?}", response);
182+
179183
Ok(response)
180184
}
181185

burn-central-client/src/user/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ impl Client {
1313
pub fn login(&self, credentials: &BurnCentralCredentials) -> Result<String, ClientError> {
1414
let url = self.join("login/api-key");
1515

16-
let res = self
16+
let form = self
1717
.http_client
1818
.post(url)
19-
.form::<BurnCentralCredentials>(credentials)
20-
.send()?
21-
.map_to_burn_central_err()?;
19+
.form::<BurnCentralCredentials>(credentials);
20+
21+
tracing::debug!("Requesting login form: {form:?}");
22+
23+
let res = form.send()?.map_to_burn_central_err()?;
2224

2325
let cookie_header = res.headers().get(SET_COOKIE);
2426
if let Some(cookie) = cookie_header {

0 commit comments

Comments
 (0)