]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Use `{}`, not `{:?}` for `PublicKey` logging
authorMatt Corallo <git@bluematt.me>
Tue, 6 Feb 2024 23:13:08 +0000 (23:13 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 13 Mar 2024 13:58:47 +0000 (13:58 +0000)
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.

lightning/src/onion_message/messenger.rs

index 37de550453283e4a383051ace821cabb44f95ff1..c6b925704967b67773a2ef06c2ad2c21f2517e25 100644 (file)
@@ -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
                                        },
                                }