From 07101deab1d4b802ce0d82e9d9020ef6985f3920 Mon Sep 17 00:00:00 2001 From: binarybaron <86064887+binarybaron@users.noreply.github.com> Date: Thu, 14 Dec 2023 18:34:30 +0100 Subject: [PATCH] Unify monero-wallet-rpc downloader logging --- swap/src/monero/wallet.rs | 2 +- swap/src/monero/wallet_rpc.rs | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/swap/src/monero/wallet.rs b/swap/src/monero/wallet.rs index 3ba99aac..8792994c 100644 --- a/swap/src/monero/wallet.rs +++ b/swap/src/monero/wallet.rs @@ -278,7 +278,7 @@ impl Wallet { match height { Err(error) => { - tracing::warn!(name = %wallet_name_clone, %error, "Failed to get current Monero wallet sync height"); + tracing::debug!(name = %wallet_name_clone, %error, "Failed to get current Monero wallet sync height"); } Ok(height) => { tracing::debug!(name = %wallet_name_clone, current_sync_height = height.height, "Syncing Monero wallet"); diff --git a/swap/src/monero/wallet_rpc.rs b/swap/src/monero/wallet_rpc.rs index e2f019a3..8973c021 100644 --- a/swap/src/monero/wallet_rpc.rs +++ b/swap/src/monero/wallet_rpc.rs @@ -221,9 +221,10 @@ impl WalletRpc { .parse::()?; tracing::info!( - "Downloading monero-wallet-rpc ({}) from {}", - content_length.big_byte(2), - DOWNLOAD_URL + progress="0%", + size=%content_length.big_byte(2), + download_url=DOWNLOAD_URL, + "Downloading monero-wallet-rpc", ); let byte_stream = response @@ -250,12 +251,24 @@ impl WalletRpc { let total = 3 * content_length; let percent = 100 * received as u64 / total; if percent != notified && percent % 10 == 0 { - tracing::debug!("{}%", percent); + tracing::info!( + progress=format!("{}%", percent), + size=%content_length.big_byte(2), + download_url=DOWNLOAD_URL, + "Downloading monero-wallet-rpc", + ); notified = percent; } file.write_all(&bytes).await?; } + tracing::info!( + progress="100%", + size=%content_length.big_byte(2), + download_url=DOWNLOAD_URL, + "Downloading monero-wallet-rpc", + ); + file.flush().await?; tracing::debug!("Extracting archive");