From 95a3a3726ef0675085ab22384b0e16ffd3ee3c3d Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 3 Sep 2024 22:43:40 +0200 Subject: [PATCH] wallet: print error on unsuccessful saving on Drop if no log feature --- src/wallet.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/wallet.rs b/src/wallet.rs index 325f3f1..02d8795 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -174,10 +174,9 @@ impl, L2: Layer2Descriptor> Drop for WalletDescr { if self.is_autosave() { if let Err(e) = self.store() { #[cfg(feature = "log")] - log::error!( - "impossible to automatically-save wallet descriptor during the Drop \ - operation: {e}" - ); + log::error!("impossible to automatically-save wallet descriptor on Drop: {e}"); + #[cfg(not(feature = "log"))] + eprintln!("impossible to automatically-save wallet descriptor on Drop: {e}") } } } @@ -238,9 +237,9 @@ impl Drop for WalletData { if self.is_autosave() { if let Err(e) = self.store() { #[cfg(feature = "log")] - log::error!( - "impossible to automatically-save wallet data during the Drop operation: {e}" - ); + log::error!("impossible to automatically-save wallet data on Drop: {e}"); + #[cfg(not(feature = "log"))] + eprintln!("impossible to automatically-save wallet data on Drop: {e}") } } } @@ -372,9 +371,9 @@ impl Drop for WalletCache { if self.is_autosave() { if let Err(e) = self.store() { #[cfg(feature = "log")] - log::error!( - "impossible to automatically-save wallet cache during the Drop operation: {e}" - ); + log::error!("impossible to automatically-save wallet cache on Drop: {e}"); + #[cfg(not(feature = "log"))] + eprintln!("impossible to automatically-save wallet cache on Drop: {e}") } } }