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:
Christian Decker
2022-07-27 15:31:46 +02:00
parent 064a5a6940
commit e1fc88ff70

View File

@@ -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 }))