mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 08:04:26 +01:00
cln-plugin: Prep the logging payload in a let
I wanted to debug why we weren't getting some log messages, and this makes that a bit easier in future.
This commit is contained in:
@@ -63,15 +63,13 @@ where
|
|||||||
// errors when forwarding. Forwarding could break due to
|
// errors when forwarding. Forwarding could break due to
|
||||||
// an interrupted connection or stdout being closed, but
|
// an interrupted connection or stdout being closed, but
|
||||||
// keeping the messages in the queue is a memory leak.
|
// keeping the messages in the queue is a memory leak.
|
||||||
let _ = out
|
let payload = json!({
|
||||||
.lock()
|
"jsonrpc": "2.0",
|
||||||
.await
|
"method": "log",
|
||||||
.send(json!({
|
"params": i
|
||||||
"jsonrpc": "2.0",
|
});
|
||||||
"method": "log",
|
|
||||||
"params": i
|
let _ = out.lock().await.send(payload).await;
|
||||||
}))
|
|
||||||
.await;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
log::set_boxed_logger(Box::new(PluginLogger { sender, filter }))
|
log::set_boxed_logger(Box::new(PluginLogger { sender, filter }))
|
||||||
|
|||||||
Reference in New Issue
Block a user