It would be great if we could use log-derive with async functions. Adding logfn to an async function gives me the following:
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> src/models/video/mod.rs:94:9
|
44 | #[logfn(ok = "INFO", err = "ERROR")]
| ------------------------------------ this is not `async`
...
94 | task::sleep(std::time::Duration::from_millis(500)).await;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks
It would be great if we could use log-derive with async functions. Adding
logfn
to an async function gives me the following:Source Snippet: