Skip to content

Commit 7dd7d6f

Browse files
committed
Add log scope to send_payment
Demonstrating how the proc macro can be used to set a thread-local logger at a public entry point. The scope name is also picked up and logged via log statements that still have an explicit logger instance.
1 parent 7f74671 commit 7dd7d6f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use bitcoin::constants::ChainHash;
2222
use bitcoin::key::constants::SECRET_KEY_SIZE;
2323
use bitcoin::network::Network;
2424
use bitcoin::transaction::Transaction;
25+
use lightning_macros::log_scope;
2526

2627
use bitcoin::hash_types::{BlockHash, Txid};
2728
use bitcoin::hashes::hmac::Hmac;
@@ -5442,6 +5443,7 @@ where
54425443
/// [`UpdateHTLCs`]: MessageSendEvent::UpdateHTLCs
54435444
/// [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
54445445
/// [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
5446+
#[log_scope(name = "send_payment")]
54455447
pub fn send_payment(
54465448
&self, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields,
54475449
payment_id: PaymentId, route_params: RouteParameters, retry_strategy: Retry,

0 commit comments

Comments
 (0)