From 31894a211a3e286bea90e3a1a43bcc0a113f527b Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Thu, 27 Jul 2023 22:51:43 +0200 Subject: [PATCH 1/2] change some debug logs to warnings and errors --- bindings/nodejs-old/src/message_handler.rs | 2 +- bindings/nodejs/src/client.rs | 2 +- bindings/nodejs/src/secret_manager.rs | 2 +- bindings/nodejs/src/wallet.rs | 2 +- sdk/src/client/api/block_builder/transaction.rs | 2 +- sdk/src/client/node_manager/syncing.rs | 2 +- sdk/src/client/secret/ledger_nano.rs | 4 ++-- sdk/src/client/secret/mod.rs | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bindings/nodejs-old/src/message_handler.rs b/bindings/nodejs-old/src/message_handler.rs index b32f2b0d5b..c6f2ca731f 100644 --- a/bindings/nodejs-old/src/message_handler.rs +++ b/bindings/nodejs-old/src/message_handler.rs @@ -63,7 +63,7 @@ impl MessageHandler { (msg, is_err) } Err(e) => { - log::debug!("{:?}", e); + log::error!("{:?}", e); ( serde_json::to_string(&Response::Error(e.into())) .expect("the response is generated manually, so unwrap is safe."), diff --git a/bindings/nodejs/src/client.rs b/bindings/nodejs/src/client.rs index 643fead784..13697a3c0c 100644 --- a/bindings/nodejs/src/client.rs +++ b/bindings/nodejs/src/client.rs @@ -53,7 +53,7 @@ impl ClientMethodHandler { (msg, is_err) } Err(e) => { - log::debug!("{:?}", e); + log::error!("{:?}", e); (format!("Couldn't parse to method with error - {e:?}"), true) } } diff --git a/bindings/nodejs/src/secret_manager.rs b/bindings/nodejs/src/secret_manager.rs index cf0b6d8019..7c5531638f 100644 --- a/bindings/nodejs/src/secret_manager.rs +++ b/bindings/nodejs/src/secret_manager.rs @@ -56,7 +56,7 @@ impl SecretManagerMethodHandler { (msg, is_err) } Err(e) => { - log::debug!("{:?}", e); + log::error!("{:?}", e); (format!("Couldn't parse to method with error - {e:?}"), true) } } diff --git a/bindings/nodejs/src/wallet.rs b/bindings/nodejs/src/wallet.rs index adc85c6f02..ad3ae44380 100644 --- a/bindings/nodejs/src/wallet.rs +++ b/bindings/nodejs/src/wallet.rs @@ -58,7 +58,7 @@ impl WalletMethodHandler { (msg, is_err) } Err(e) => { - log::debug!("{:?}", e); + log::error!("{:?}", e); ( serde_json::to_string(&Response::Error(e.into())).expect("json to string error"), true, diff --git a/sdk/src/client/api/block_builder/transaction.rs b/sdk/src/client/api/block_builder/transaction.rs index 76dedfb2fa..202e8e2ca5 100644 --- a/sdk/src/client/api/block_builder/transaction.rs +++ b/sdk/src/client/api/block_builder/transaction.rs @@ -106,7 +106,7 @@ impl<'a> ClientBlockBuilder<'a> { let conflict = verify_semantic(&prepared_transaction_data.inputs_data, &tx_payload, current_time)?; if conflict != ConflictReason::None { - log::debug!("[sign_transaction] conflict: {conflict:?} for {:#?}", tx_payload); + log::warn!("[sign_transaction] conflict: {conflict:?} for {:#?}", tx_payload); return Err(Error::TransactionSemantic(conflict)); } diff --git a/sdk/src/client/node_manager/syncing.rs b/sdk/src/client/node_manager/syncing.rs index 988e98d761..444a9f063e 100644 --- a/sdk/src/client/node_manager/syncing.rs +++ b/sdk/src/client/node_manager/syncing.rs @@ -83,7 +83,7 @@ impl ClientInner { } } } else { - log::debug!("{} is not healthy: {:?}", node.url, info); + log::warn!("{} is not healthy: {:?}", node.url, info); } } Err(err) => { diff --git a/sdk/src/client/secret/ledger_nano.rs b/sdk/src/client/secret/ledger_nano.rs index 0b57b8a36d..8ab21de268 100644 --- a/sdk/src/client/secret/ledger_nano.rs +++ b/sdk/src/client/secret/ledger_nano.rs @@ -329,7 +329,7 @@ impl SecretManage for LedgerSecretManager { } } } else { - log::debug!("[LEDGER] unsupported output"); + log::warn!("[LEDGER] unsupported output"); return Err(Error::MiscError.into()); } @@ -338,7 +338,7 @@ impl SecretManage for LedgerSecretManager { // was index found? if remainder_index as usize == essence.outputs().len() { - log::debug!("[LEDGER] remainder_index not found"); + log::warn!("[LEDGER] remainder_index not found"); return Err(Error::MiscError.into()); } } diff --git a/sdk/src/client/secret/mod.rs b/sdk/src/client/secret/mod.rs index 784c02aa7a..0350239a9c 100644 --- a/sdk/src/client/secret/mod.rs +++ b/sdk/src/client/secret/mod.rs @@ -519,7 +519,7 @@ where let conflict = verify_semantic(&inputs_data, &tx_payload, current_time)?; if conflict != ConflictReason::None { - log::debug!("[sign_transaction] conflict: {conflict:?} for {:#?}", tx_payload); + log::warn!("[sign_transaction] conflict: {conflict:?} for {:#?}", tx_payload); return Err(Error::TransactionSemantic(conflict)); } From fb2377275bfeaa0eeea9b99ba5fc15450333f99e Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Fri, 28 Jul 2023 09:30:41 +0200 Subject: [PATCH 2/2] revert some --- bindings/nodejs-old/src/message_handler.rs | 2 +- sdk/src/client/api/block_builder/transaction.rs | 2 +- sdk/src/client/secret/ledger_nano.rs | 4 ++-- sdk/src/client/secret/mod.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bindings/nodejs-old/src/message_handler.rs b/bindings/nodejs-old/src/message_handler.rs index c6f2ca731f..b32f2b0d5b 100644 --- a/bindings/nodejs-old/src/message_handler.rs +++ b/bindings/nodejs-old/src/message_handler.rs @@ -63,7 +63,7 @@ impl MessageHandler { (msg, is_err) } Err(e) => { - log::error!("{:?}", e); + log::debug!("{:?}", e); ( serde_json::to_string(&Response::Error(e.into())) .expect("the response is generated manually, so unwrap is safe."), diff --git a/sdk/src/client/api/block_builder/transaction.rs b/sdk/src/client/api/block_builder/transaction.rs index 202e8e2ca5..76dedfb2fa 100644 --- a/sdk/src/client/api/block_builder/transaction.rs +++ b/sdk/src/client/api/block_builder/transaction.rs @@ -106,7 +106,7 @@ impl<'a> ClientBlockBuilder<'a> { let conflict = verify_semantic(&prepared_transaction_data.inputs_data, &tx_payload, current_time)?; if conflict != ConflictReason::None { - log::warn!("[sign_transaction] conflict: {conflict:?} for {:#?}", tx_payload); + log::debug!("[sign_transaction] conflict: {conflict:?} for {:#?}", tx_payload); return Err(Error::TransactionSemantic(conflict)); } diff --git a/sdk/src/client/secret/ledger_nano.rs b/sdk/src/client/secret/ledger_nano.rs index 8ab21de268..0b57b8a36d 100644 --- a/sdk/src/client/secret/ledger_nano.rs +++ b/sdk/src/client/secret/ledger_nano.rs @@ -329,7 +329,7 @@ impl SecretManage for LedgerSecretManager { } } } else { - log::warn!("[LEDGER] unsupported output"); + log::debug!("[LEDGER] unsupported output"); return Err(Error::MiscError.into()); } @@ -338,7 +338,7 @@ impl SecretManage for LedgerSecretManager { // was index found? if remainder_index as usize == essence.outputs().len() { - log::warn!("[LEDGER] remainder_index not found"); + log::debug!("[LEDGER] remainder_index not found"); return Err(Error::MiscError.into()); } } diff --git a/sdk/src/client/secret/mod.rs b/sdk/src/client/secret/mod.rs index 0350239a9c..784c02aa7a 100644 --- a/sdk/src/client/secret/mod.rs +++ b/sdk/src/client/secret/mod.rs @@ -519,7 +519,7 @@ where let conflict = verify_semantic(&inputs_data, &tx_payload, current_time)?; if conflict != ConflictReason::None { - log::warn!("[sign_transaction] conflict: {conflict:?} for {:#?}", tx_payload); + log::debug!("[sign_transaction] conflict: {conflict:?} for {:#?}", tx_payload); return Err(Error::TransactionSemantic(conflict)); }