@@ -71,7 +71,7 @@ use crate::prelude::*;
7171/// # use std::sync::Arc;
7272/// # struct FakeLogger;
7373/// # impl Logger for FakeLogger {
74- /// # fn log(&self, record: &Record) { unimplemented!() }
74+ /// # fn log(&self, record: &Record) { println!("{:?}" , record); }
7575/// # }
7676/// # struct FakeMessageRouter {}
7777/// # impl MessageRouter for FakeMessageRouter {
@@ -97,7 +97,8 @@ use crate::prelude::*;
9797/// &keys_manager, &keys_manager, logger, message_router, &offers_message_handler,
9898/// &custom_message_handler
9999/// );
100- ///
100+
101+ /// # #[derive(Debug)]
101102/// # struct YourCustomMessage {}
102103/// impl Writeable for YourCustomMessage {
103104/// fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
@@ -517,6 +518,9 @@ where
517518 pub fn send_onion_message < T : OnionMessageContents > (
518519 & self , path : OnionMessagePath , contents : T , reply_path : Option < BlindedPath >
519520 ) -> Result < ( ) , SendError > {
521+
522+ log_trace ! ( self . logger, "Sending onion message: {:?}" , contents) ;
523+
520524 let ( first_node_id, onion_msg) = create_onion_message (
521525 & self . entropy_source , & self . node_signer , & self . secp_ctx , path, contents, reply_path
522526 ) ?;
@@ -570,7 +574,7 @@ where
570574 } ,
571575 } ;
572576
573- log_trace ! ( self . logger, "Sending onion message {} " , log_suffix ) ;
577+ log_trace ! ( self . logger, "Responding to onion message with path_id {:02x?} with: {:?} " , reply_path , contents ) ;
574578
575579 if let Err ( e) = self . send_onion_message ( path, contents, reply_path) {
576580 log_trace ! ( self . logger, "Failed sending onion message {}: {:?}" , log_suffix, e) ;
@@ -630,8 +634,8 @@ where
630634 ) {
631635 Ok ( PeeledOnion :: Receive ( message, path_id, reply_path) ) => {
632636 log_trace ! ( self . logger,
633- "Received an onion message with path_id {:02x?} and {} reply_path" ,
634- path_id , if reply_path. is_some( ) { "a" } else { "no" } ) ;
637+ "Received an onion message with path_id {:02x?} with : {:?} and reply_path : {}" , path_id ,
638+ message , if reply_path. is_some( ) { "a" } else { "no" } ) ;
635639
636640 match message {
637641 ParsedOnionMessageContents :: Offers ( msg) => {
0 commit comments