I'm pretty new to Rust so sorry if this should be obvious.
Looking at the example given in examples it calls tokio::time::sleep(Duration::from_secs(1)).await;. Now if I remove that line my loki instance will not receive a log. In my understanding that is because the background reporting thread is killed when the program exits - before it has a chance to deliver the log to loki.
So my question is: Is there a way to ensure all logs have been delivered before exiting the program? Thanks.