use logfn::logfn; #[logfn(Pre, Info, "execute {fn}")] #[logfn(Post, Error, "failed to add: {ret:?}", if = "Option::is_none")] #[logfn(Post, Info, "executed add", if = "Option::is_some")] fn add(a: usize, b: usize) -> Option { a.checked_add(b) } #[logfn(Pre, Info, "execute add")] fn generics(a: T) -> T where T: std::fmt::Debug, { a } #[logfn(Pre, Info, "execute async_fn")] #[logfn(Post, Info, "executed async_fn")] async fn async_fn(a: usize) -> usize { async { a }.await }