Demote / promote log messages to their appropriate level

This commit is contained in:
Thomas Eizinger 2021-02-26 17:03:07 +11:00
parent 7387884e6d
commit bbbe5f7ae8
No known key found for this signature in database
GPG key ID: 651AC83A6C6C8B96
7 changed files with 25 additions and 22 deletions

View file

@ -12,7 +12,7 @@ use async_recursion::async_recursion;
use rand::rngs::OsRng;
use std::sync::Arc;
use tokio::select;
use tracing::info;
use tracing::{trace, warn};
use uuid::Uuid;
pub fn is_complete(state: &BobState) -> bool {
@ -61,7 +61,7 @@ async fn run_until_internal(
swap_id: Uuid,
execution_params: ExecutionParams,
) -> Result<BobState> {
info!("Current state: {}", state);
trace!("Current state: {}", state);
if is_target_state(&state) {
Ok(state)
} else {
@ -186,7 +186,7 @@ async fn run_until_internal(
match state4? {
Ok(state4) => BobState::XmrLocked(state4),
Err(InsufficientFunds {..}) => {
info!("The other party has locked insufficient Monero funds! Waiting for refund...");
warn!("The other party has locked insufficient Monero funds! Waiting for refund...");
state.wait_for_cancel_timelock_to_expire(bitcoin_wallet.as_ref()).await?;
let state4 = state.cancel();
BobState::CancelTimelockExpired(state4)