.
//
//!
//! # Logger Macro Impl
//!
use ::TokenStream;
use ::quote;
use ::{,};
pub(crate) fn logger_impl(attr:item:) -> {
// println!("attr: (is_empty: {}) {attr}", attr.to_string().is_empty());
// Parse the input as `ItemFn` which is a type provided
// by `syn` to represent a function.
let= parse_macro_input!(as);
let{
// The function signature
,
// The visibility specifier of this function
,
// The function block or body
,
// Other attributes applied to this function
,
} =;
// Extract statements in the body of the functions
let=;
// Store the function identifier for logging
let= ifto_string()is_empty() {
clone()to_string()
} else {
to_string()
};
// Reconstruct the function as output using parsed input
quote!(
// Reapply all the other attributes on this function.
// The compiler doesn't include the macro we are
// currently working in this list.
#(#)*
// Reconstruct the function declaration
##{
// At the beginning of the function, borrow a reference to
// module level static logger.
let= LOGGER;
let mut=borrow_mut();
set_fn_name(#);
#(#)*
}
)
into()
}