Skip to content

Commit

Permalink
Log c2c calls in test output (#5242)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Jan 23, 2024
1 parent f52f25e commit c1a43b3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/libraries/canister_client/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use candid::Principal;
use ic_cdk::api::call::{CallResult, RejectionCode};
use std::fmt::Debug;
use tracing::Level;

pub use canister_client_macros::*;

Expand Down Expand Up @@ -49,7 +50,11 @@ pub async fn make_c2c_call_raw(
payload_bytes: &[u8],
cycles: u128,
) -> CallResult<Vec<u8>> {
tracing::trace!(method_name, %canister_id, "Starting c2c call");
let tracing_enabled = tracing::enabled!(Level::TRACE);
if tracing_enabled {
tracing::trace!(method_name, %canister_id, "Starting c2c call");
ic_cdk::print(format!("Making call to {canister_id} \"{method_name}\""));
}

let response = ic_cdk::api::call::call_raw128(canister_id, method_name, payload_bytes, cycles).await;

Expand Down

0 comments on commit c1a43b3

Please sign in to comment.