@@ -71,7 +71,7 @@ use crate::prelude::*;
71
71
/// # use std::sync::Arc;
72
72
/// # struct FakeLogger;
73
73
/// # impl Logger for FakeLogger {
74
- /// # fn log(&self, record: Record) { unimplemented!() }
74
+ /// # fn log(&self, record: Record) { println!("{:?}" , record); }
75
75
/// # }
76
76
/// # struct FakeMessageRouter {}
77
77
/// # impl MessageRouter for FakeMessageRouter {
@@ -97,7 +97,8 @@ use crate::prelude::*;
97
97
/// &keys_manager, &keys_manager, logger, message_router, &offers_message_handler,
98
98
/// &custom_message_handler
99
99
/// );
100
- ///
100
+
101
+ /// # #[derive(Debug)]
101
102
/// # struct YourCustomMessage {}
102
103
/// impl Writeable for YourCustomMessage {
103
104
/// fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
@@ -517,6 +518,9 @@ where
517
518
pub fn send_onion_message < T : OnionMessageContents > (
518
519
& self , path : OnionMessagePath , contents : T , reply_path : Option < BlindedPath >
519
520
) -> Result < ( ) , SendError > {
521
+
522
+ log_trace ! ( self . logger, "Sending onion message: {:?}" , contents) ;
523
+
520
524
let ( first_node_id, onion_msg) = create_onion_message (
521
525
& self . entropy_source , & self . node_signer , & self . secp_ctx , path, contents, reply_path
522
526
) ?;
@@ -570,7 +574,7 @@ where
570
574
} ,
571
575
} ;
572
576
573
- log_trace ! ( self . logger, "Sending onion message {}" , log_suffix) ;
577
+ log_trace ! ( self . logger, "Sending onion message {}: {:?} " , log_suffix, contents ) ;
574
578
575
579
if let Err ( e) = self . send_onion_message ( path, contents, reply_path) {
576
580
log_trace ! ( self . logger, "Failed sending onion message {}: {:?}" , log_suffix, e) ;
@@ -629,9 +633,10 @@ where
629
633
msg, & self . secp_ctx , & * self . node_signer , & * self . logger , & * self . custom_handler
630
634
) {
631
635
Ok ( PeeledOnion :: Receive ( message, path_id, reply_path) ) => {
632
- 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" } ) ;
636
+ log_trace ! (
637
+ self . logger,
638
+ "Received an onion message with path_id {:02x?} and {} reply_path: {:?}" ,
639
+ path_id, if reply_path. is_some( ) { "a" } else { "no" } , message) ;
635
640
636
641
match message {
637
642
ParsedOnionMessageContents :: Offers ( msg) => {
0 commit comments