funlog
A Rust attribute macro for function logging with configurable options.
Features
- Log function entry and exit
- Parameter value logging
- Return value logging
- Generic type support
- Configurable log levels
- Output length limits
- Support for nested function calls
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Usage
Basic Logging
use funlog;
Parameter Logging
Return Value Logging
Generic Function Logging
Length Limits
Limit the length of logged parameters and return values:
Log Levels
Specify different log levels (debug, info, warn, error, trace):
Nested Function Calls
Track function call chains:
Configuration Options
param- Enable parameter loggingret- Enable return value logginggener- Enable generic type information loggingparam="n"- Limit parameter log length to n charactersret="n"- Limit return value log length to n characters- Log levels:
debuginfo(default)warnerrortrace
License
MIT License