Skip to content

Commit 828385a

Browse files
committed
Log PublicKeys as Display, not Debug
1 parent f0b5c0b commit 828385a

File tree

7 files changed

+29
-26
lines changed

7 files changed

+29
-26
lines changed

lightning-liquidity/src/lsps0/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ where
109109
false,
110110
"Client handler received LSPS0 request message. This should never happen."
111111
);
112-
Err(LightningError { err: format!("Client handler received LSPS0 request message from node {:?}. This should never happen.", counterparty_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)})
112+
Err(LightningError { err: format!("Client handler received LSPS0 request message from node {}. This should never happen.", counterparty_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)})
113113
},
114114
}
115115
}

lightning-liquidity/src/lsps0/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl LSPSProtocolMessageHandler for LSPS0ServiceHandler {
7373
false,
7474
"Service handler received LSPS0 response message. This should never happen."
7575
);
76-
Err(LightningError { err: format!("Service handler received LSPS0 response message from node {:?}. This should never happen.", counterparty_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)})
76+
Err(LightningError { err: format!("Service handler received LSPS0 response message from node {}. This should never happen.", counterparty_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)})
7777
},
7878
}
7979
}

lightning-liquidity/src/lsps1/client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ where
141141
},
142142
None => Err(LightningError {
143143
err: format!(
144-
"Received get_info response from unknown peer: {:?}",
144+
"Received get_info response from unknown peer: {}",
145145
counterparty_node_id
146146
),
147147
action: ErrorAction::IgnoreAndLog(Level::Debug),
@@ -187,7 +187,7 @@ where
187187
None => {
188188
return Err(LightningError {
189189
err: format!(
190-
"Received get_info error response from an unknown counterparty ({:?})",
190+
"Received get_info error response from an unknown counterparty {}",
191191
counterparty_node_id
192192
),
193193
action: ErrorAction::IgnoreAndLog(Level::Debug),
@@ -304,7 +304,7 @@ where
304304
None => {
305305
return Err(LightningError {
306306
err: format!(
307-
"Received error response for a create order request from an unknown counterparty ({:?})",
307+
"Received error response for a create order request from an unknown counterparty {}",
308308
counterparty_node_id
309309
),
310310
action: ErrorAction::IgnoreAndLog(Level::Debug),

lightning-liquidity/src/lsps2/client.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ where
227227
None => {
228228
return Err(LightningError {
229229
err: format!(
230-
"Received get_info response from unknown peer: {:?}",
230+
"Received get_info response from unknown peer: {}",
231231
counterparty_node_id
232232
),
233233
action: ErrorAction::IgnoreAndLog(Level::Debug),
@@ -275,7 +275,7 @@ where
275275
Err(lightning_error)
276276
},
277277
None => {
278-
return Err(LightningError { err: format!("Received error response for a get_info request from an unknown counterparty ({:?})",counterparty_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
278+
return Err(LightningError { err: format!("Received error response for a get_info request from an unknown counterparty {}",counterparty_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
279279
},
280280
}
281281
}
@@ -321,7 +321,7 @@ where
321321
None => {
322322
return Err(LightningError {
323323
err: format!(
324-
"Received buy response from unknown peer: {:?}",
324+
"Received buy response from unknown peer: {}",
325325
counterparty_node_id
326326
),
327327
action: ErrorAction::IgnoreAndLog(Level::Debug),
@@ -363,7 +363,13 @@ where
363363
Err(lightning_error)
364364
},
365365
None => {
366-
return Err(LightningError { err: format!("Received error response for a buy request from an unknown counterparty ({:?})", counterparty_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
366+
return Err(LightningError {
367+
err: format!(
368+
"Received error response for a buy request from an unknown counterparty {}",
369+
counterparty_node_id
370+
),
371+
action: ErrorAction::IgnoreAndLog(Level::Debug),
372+
});
367373
},
368374
}
369375
}
@@ -400,7 +406,7 @@ where
400406
false,
401407
"Client handler received LSPS2 request message. This should never happen."
402408
);
403-
Err(LightningError { err: format!("Client handler received LSPS2 request message from node {:?}. This should never happen.", counterparty_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)})
409+
Err(LightningError { err: format!("Client handler received LSPS2 request message from node {}. This should never happen.", counterparty_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)})
404410
},
405411
}
406412
}

lightning-liquidity/src/lsps2/service.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ where
696696
}
697697
},
698698
None => Err(APIError::APIMisuseError {
699-
err: format!("No state for the counterparty exists: {:?}", counterparty_node_id),
699+
err: format!("No state for the counterparty exists: {}", counterparty_node_id),
700700
}),
701701
}
702702
}
@@ -752,7 +752,7 @@ where
752752
}
753753
},
754754
None => Err(APIError::APIMisuseError {
755-
err: format!("No state for the counterparty exists: {:?}", counterparty_node_id),
755+
err: format!("No state for the counterparty exists: {}", counterparty_node_id),
756756
}),
757757
}
758758
}
@@ -822,10 +822,7 @@ where
822822
},
823823
None => {
824824
return Err(APIError::APIMisuseError {
825-
err: format!(
826-
"No state for the counterparty exists: {:?}",
827-
counterparty_node_id
828-
),
825+
err: format!("No state for the counterparty exists: {}", counterparty_node_id),
829826
})
830827
},
831828
};
@@ -1731,7 +1728,7 @@ where
17311728
false,
17321729
"Service handler received LSPS2 response message. This should never happen."
17331730
);
1734-
Err(LightningError { err: format!("Service handler received LSPS2 response message from node {:?}. This should never happen.", counterparty_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)})
1731+
Err(LightningError { err: format!("Service handler received LSPS2 response message from node {}. This should never happen.", counterparty_node_id), action: ErrorAction::IgnoreAndLog(Level::Info)})
17351732
},
17361733
}
17371734
}

lightning-liquidity/src/lsps5/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ where
677677
"Service handler received LSPS5 response message. This should never happen."
678678
);
679679
let err = format!(
680-
"Service handler received LSPS5 response message from node {:?}. This should never happen.",
680+
"Service handler received LSPS5 response message from node {}. This should never happen.",
681681
counterparty_node_id
682682
);
683683
Err(LightningError { err, action: ErrorAction::IgnoreAndLog(Level::Info) })

lightning-liquidity/src/manager.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ where
680680
lsps0_service_handler.handle_message(msg, sender_node_id)?;
681681
},
682682
None => {
683-
return Err(LightningError { err: format!("Received LSPS0 request message without LSPS0 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
683+
return Err(LightningError { err: format!("Received LSPS0 request message without LSPS0 service handler configured. From node {}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
684684
},
685685
}
686686
},
@@ -690,7 +690,7 @@ where
690690
lsps1_client_handler.handle_message(msg, sender_node_id)?;
691691
},
692692
None => {
693-
return Err(LightningError { err: format!("Received LSPS1 response message without LSPS1 client handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
693+
return Err(LightningError { err: format!("Received LSPS1 response message without LSPS1 client handler configured. From node {}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
694694
},
695695
}
696696
},
@@ -701,19 +701,19 @@ where
701701
lsps1_service_handler.handle_message(_msg, sender_node_id)?;
702702
},
703703
None => {
704-
return Err(LightningError { err: format!("Received LSPS1 request message without LSPS1 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
704+
return Err(LightningError { err: format!("Received LSPS1 request message without LSPS1 service handler configured. From node {}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
705705
},
706706
}
707707
#[cfg(not(lsps1_service))]
708-
return Err(LightningError { err: format!("Received LSPS1 request message without LSPS1 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
708+
return Err(LightningError { err: format!("Received LSPS1 request message without LSPS1 service handler configured. From node {}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
709709
},
710710
LSPSMessage::LSPS2(msg @ LSPS2Message::Response(..)) => {
711711
match &self.lsps2_client_handler {
712712
Some(lsps2_client_handler) => {
713713
lsps2_client_handler.handle_message(msg, sender_node_id)?;
714714
},
715715
None => {
716-
return Err(LightningError { err: format!("Received LSPS2 response message without LSPS2 client handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
716+
return Err(LightningError { err: format!("Received LSPS2 response message without LSPS2 client handler configured. From node {}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
717717
},
718718
}
719719
},
@@ -723,7 +723,7 @@ where
723723
lsps2_service_handler.handle_message(msg, sender_node_id)?;
724724
},
725725
None => {
726-
return Err(LightningError { err: format!("Received LSPS2 request message without LSPS2 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
726+
return Err(LightningError { err: format!("Received LSPS2 request message without LSPS2 service handler configured. From node {}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
727727
},
728728
}
729729
},
@@ -733,7 +733,7 @@ where
733733
lsps5_client_handler.handle_message(msg, sender_node_id)?;
734734
},
735735
None => {
736-
return Err(LightningError { err: format!("Received LSPS5 response message without LSPS5 client handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
736+
return Err(LightningError { err: format!("Received LSPS5 response message without LSPS5 client handler configured. From node {}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
737737
},
738738
}
739739
},
@@ -766,7 +766,7 @@ where
766766
lsps5_service_handler.handle_message(msg, sender_node_id)?;
767767
},
768768
None => {
769-
return Err(LightningError { err: format!("Received LSPS5 request message without LSPS5 service handler configured. From node = {:?}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
769+
return Err(LightningError { err: format!("Received LSPS5 request message without LSPS5 service handler configured. From node {}", sender_node_id), action: ErrorAction::IgnoreAndLog(Level::Debug)});
770770
},
771771
}
772772
},

0 commit comments

Comments
 (0)