pytest: Add a test for the cln-plugin logging integration

This commit is contained in:
Christian Decker
2022-01-24 13:19:45 +01:00
committed by Rusty Russell
parent f5e1829117
commit fe21b89b56
2 changed files with 19 additions and 7 deletions

View File

@@ -6,9 +6,10 @@ use tokio;
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
env_logger::init();
let (plugin, stdin) = Builder::new((), tokio::io::stdin(), tokio::io::stdout()).build();
plugin.run(stdin).await;
Ok(())
tokio::spawn(async {
tokio::time::sleep(tokio::time::Duration::from_millis(1000)).await;
log::info!("Hello world");
});
plugin.run(stdin).await
}