Expand description
§Funlog - Function Logging Macro
Funlog is a procedural macro that automatically adds logging to functions. It supports various logging levels, parameter logging, return value logging, and flexible positioning of log statements.
§Features
- Multiple log levels:
print,trace,debug,info,warn,error - Parameter control:
all,none, orparams(param1, param2) - Position control:
onStart,onEnd,onStartEnd - Return value logging:
retVal - Conflict detection and helpful error messages
§Examples
use funlog::funlog;
#[funlog(debug, all, retVal)]
fn calculate(x: i32, y: i32) -> i32 {
x + y
}
#[funlog(info, params(name), onStart)]
fn greet(name: &str, age: u32) {
println!("Hello, {}!", name);
}Attribute Macros§
- funlog
- A procedural macro attribute for adding automatic logging to functions.