From 94a8c2a54e1c055ec46941ce125c769af8f322de Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Sun, 30 Jun 2024 14:35:10 -0400 Subject: [PATCH] move receipts to their own log facility --- veilid-core/src/logging/facilities.rs | 3 ++- veilid-core/src/network_manager/receipt_manager.rs | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/veilid-core/src/logging/facilities.rs b/veilid-core/src/logging/facilities.rs index 94045a93..2d91255f 100644 --- a/veilid-core/src/logging/facilities.rs +++ b/veilid-core/src/logging/facilities.rs @@ -1,4 +1,4 @@ -pub static DEFAULT_LOG_FACILITIES_IGNORE_LIST: [&str; 27] = [ +pub static DEFAULT_LOG_FACILITIES_IGNORE_LIST: [&str; 28] = [ "mio", "h2", "hyper", @@ -26,6 +26,7 @@ pub static DEFAULT_LOG_FACILITIES_IGNORE_LIST: [&str; 27] = [ "network_result", "dht", "fanout", + "receipt", ]; pub static DEFAULT_LOG_FACILITIES_ENABLED_LIST: [&str; 8] = [ diff --git a/veilid-core/src/network_manager/receipt_manager.rs b/veilid-core/src/network_manager/receipt_manager.rs index f1a3f619..f06a9a60 100644 --- a/veilid-core/src/network_manager/receipt_manager.rs +++ b/veilid-core/src/network_manager/receipt_manager.rs @@ -326,7 +326,7 @@ impl ReceiptManager { callback: impl ReceiptCallback, ) { let receipt_nonce = receipt.get_nonce(); - log_rpc!(debug "== New Multiple Receipt ({}) {} ", expected_returns, receipt_nonce.encode()); + event!(target: "receipt", Level::DEBUG, "== New Multiple Receipt ({}) {} ", expected_returns, receipt_nonce.encode()); let record = Arc::new(Mutex::new(ReceiptRecord::new( receipt, expiration, @@ -346,7 +346,7 @@ impl ReceiptManager { eventual: ReceiptSingleShotType, ) { let receipt_nonce = receipt.get_nonce(); - log_rpc!(debug "== New SingleShot Receipt {}", receipt_nonce.encode()); + event!(target: "receipt", Level::DEBUG, "== New SingleShot Receipt {}", receipt_nonce.encode()); let record = Arc::new(Mutex::new(ReceiptRecord::new_single_shot( receipt, expiration, eventual, @@ -375,7 +375,7 @@ impl ReceiptManager { #[allow(dead_code)] pub async fn cancel_receipt(&self, nonce: &Nonce) -> EyreResult<()> { - log_rpc!(debug "== Cancel Receipt {}", nonce.encode()); + event!(target: "receipt", Level::DEBUG, "== Cancel Receipt {}", nonce.encode()); // Remove the record let record = { @@ -412,7 +412,7 @@ impl ReceiptManager { let receipt_nonce = receipt.get_nonce(); let extra_data = receipt.get_extra_data(); - log_rpc!(debug "<<== RECEIPT {} <- {}{}", + event!(target: "receipt", Level::DEBUG, "<<== RECEIPT {} <- {}{}", receipt_nonce.encode(), match receipt_returned { ReceiptReturned::OutOfBand => "OutOfBand".to_owned(),