Skip to content

Commit

Permalink
Log available LSPs in debug info (#811)
Browse files Browse the repository at this point in the history
* Log available LSPs in debug info

* Log connected lsp id
  • Loading branch information
dleutenegger authored Dec 6, 2023
1 parent 45a0d93 commit 44aa635
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,21 @@ impl LightningNode {
///
/// Throws an error in case that the necessary information can't be retrieved.
pub fn log_debug_info(&self) -> Result<()> {
let available_lsps = self
.rt
.handle()
.block_on(self.sdk.list_lsps())
.map_to_runtime_error(RuntimeErrorCode::NodeUnavailable, "Couldn't list lsps")?;

let connected_lsp = self
.rt
.handle()
.block_on(self.sdk.lsp_id())
.map_to_runtime_error(
RuntimeErrorCode::NodeUnavailable,
"Failed to get current lsp id",
)?;

let peers = self
.rt
.handle()
Expand All @@ -1504,7 +1519,11 @@ impl LightningNode {

info!("List of peers:\n{}", peers);
info!("List of peer channels:\n{}", peer_channels);

info!("List of available lsps:\n{:?}", available_lsps);
info!(
"Connected lsp id:\n{}",
connected_lsp.unwrap_or("<no connection>".to_string())
);
Ok(())
}

Expand Down

0 comments on commit 44aa635

Please sign in to comment.