Always log whole causality chain for errors.

This commit is contained in:
Philipp Hoenisch 2021-05-11 11:08:33 +10:00
parent c011e95062
commit 316f95c65b
No known key found for this signature in database
GPG key ID: E5F8E74C672BC666
8 changed files with 40 additions and 47 deletions

View file

@ -155,13 +155,13 @@ impl Wallet {
let new_status = match client.lock().await.status_of_script(&tx) {
Ok(new_status) => new_status,
Err(error) => {
tracing::warn!(%txid, %error, "Failed to get status of script.");
tracing::warn!(%txid, "Failed to get status of script. Error {:#}", error);
return;
}
};
if Some(new_status) != last_status {
tracing::debug!(%txid, status = %new_status, "Transaction status.");
tracing::debug!(%txid, status = %new_status, "Transaction status");
}
last_status = Some(new_status);
@ -201,7 +201,7 @@ impl Subscription {
let conf_target = self.finality_confirmations;
let txid = self.txid;
tracing::info!(%txid, required_confirmation=%conf_target, "Waiting for Bitcoin transaction finality.");
tracing::info!(%txid, required_confirmation=%conf_target, "Waiting for Bitcoin transaction finality");
let mut seen_confirmations = 0;
@ -213,7 +213,7 @@ impl Subscription {
tracing::info!(%txid,
seen_confirmations = %confirmations,
needed_confirmations = %conf_target,
"Waiting for Bitcoin transaction finality.");
"Waiting for Bitcoin transaction finality");
seen_confirmations = confirmations;
}
@ -593,7 +593,7 @@ impl Client {
[] => Ok(ScriptStatus::Unseen),
[remaining @ .., last] => {
if !remaining.is_empty() {
tracing::warn!("Found more than a single history entry for script. This is highly unexpected and those history entries will be ignored.")
tracing::warn!("Found more than a single history entry for script. This is highly unexpected and those history entries will be ignored")
}
if last.height <= 0 {
@ -619,7 +619,7 @@ impl Client {
if let Some(new_block) = latest_block {
tracing::debug!(
block_height = new_block.height,
"Got notification for new block."
"Got notification for new block"
);
self.latest_block = BlockHeight::try_from(new_block)?;
}