From 0518cb28a6fbcade17ce82c8b1c28db8fd037fa7 Mon Sep 17 00:00:00 2001 From: Hamish Peebles Date: Sat, 28 Dec 2024 00:41:35 +0000 Subject: [PATCH] Switch last remaining places over to new logging method (#39) --- canister/src/jobs/check_for_new_nns_votes.rs | 2 +- canister/src/jobs/process_votes.rs | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/canister/src/jobs/check_for_new_nns_votes.rs b/canister/src/jobs/check_for_new_nns_votes.rs index 10d6a81..2065fc9 100644 --- a/canister/src/jobs/check_for_new_nns_votes.rs +++ b/canister/src/jobs/check_for_new_nns_votes.rs @@ -51,7 +51,7 @@ async fn run_single( true } error => { - ic_cdk::eprintln!("Error calling `get_neuron_info`: {error:?}"); + log(format!("Error calling `get_neuron_info`: {error:?}")); false } } diff --git a/canister/src/jobs/process_votes.rs b/canister/src/jobs/process_votes.rs index 3fa1ff1..8c875f4 100644 --- a/canister/src/jobs/process_votes.rs +++ b/canister/src/jobs/process_votes.rs @@ -91,7 +91,7 @@ async fn process_vote(vote: VoteToProcess) { } } Err(error) => { - ic_cdk::eprintln!("Error calling `get_wtn_proposal_id`: {error:?}"); + log(format!("Error calling `get_wtn_proposal_id`: {error:?}")); Some(VoteToProcess::NnsVote(pair_id, nns_vote)) } } @@ -125,18 +125,20 @@ async fn process_vote(vote: VoteToProcess) { s.record_wtn_vote_registered(pair_id, wtn_vote); } Ok(Some(CommandResponse::Error(error))) => { - ic_cdk::eprintln!( + log(format!( "Governance canister returned an error: {error:?}. Args: {args:?}" - ); + )); s.push_vote_to_process(VoteToProcess::PendingWtnVote(pair_id, wtn_vote)); } Ok(None) => { - ic_cdk::eprintln!( + log(format!( "Governance canister returned an empty response. Args: {args:?}" - ); + )); } Err(error) => { - ic_cdk::eprintln!("Error calling `manage_neuron`: {error:?}. Args: {args:?}"); + log(format!( + "Error calling `manage_neuron`: {error:?}. Args: {args:?}" + )); s.push_vote_to_process(VoteToProcess::PendingWtnVote(pair_id, wtn_vote)); } });