From: Matt Corallo Date: Tue, 6 Feb 2024 23:13:08 +0000 (+0000) Subject: Use `{}`, not `{:?}` for `PublicKey` logging X-Git-Tag: v0.0.123-beta~43^2~2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=98340dc25371eeae2854bebf6ac0f4faba0d2830;p=rust-lightning Use `{}`, not `{:?}` for `PublicKey` logging The `Debug` serialization of `PublicKey`s includes both the X and Y coordinate, which isn't something most of our users deal with. Instead, logging using `Display` gives users the keys they're used to. --- diff --git a/lightning/src/onion_message/messenger.rs b/lightning/src/onion_message/messenger.rs index 37de55045..c6b925704 100644 --- a/lightning/src/onion_message/messenger.rs +++ b/lightning/src/onion_message/messenger.rs @@ -766,7 +766,7 @@ where }, Ok(SendSuccess::BufferedAwaitingConnection(node_id)) => { log_trace!( - self.logger, "Buffered onion message waiting on peer connection {}: {:?}", + self.logger, "Buffered onion message waiting on peer connection {}: {}", log_suffix, node_id ); }, @@ -957,7 +957,7 @@ where Ok(PeeledOnion::Forward(next_node_id, onion_message)) => { let mut message_recipients = self.message_recipients.lock().unwrap(); if outbound_buffer_full(&next_node_id, &message_recipients) { - log_trace!(self.logger, "Dropping forwarded onion message to peer {:?}: outbound buffer full", next_node_id); + log_trace!(self.logger, "Dropping forwarded onion message to peer {}: outbound buffer full", next_node_id); return } @@ -974,7 +974,7 @@ where log_trace!(self.logger, "Forwarding an onion message to peer {}", next_node_id); }, _ => { - log_trace!(self.logger, "Dropping forwarded onion message to disconnected peer {:?}", next_node_id); + log_trace!(self.logger, "Dropping forwarded onion message to disconnected peer {}", next_node_id); return }, }