#[log_cu_usage]Available on crate feature
macro only.Expand description
Attribute macro for instrumenting functions with compute unit logging.
This macro wraps the decorated function with additional logging statements that print the function name and the number of compute units used before and after the function execution.
§Effects
- Adds a log message with the function name at the end of execution with amount of CU consumed.
§Note
This macro consumes an additional compute units per call due to the logging operations.
§Example
ⓘ
#[atlas_program_log::log_cu_usage]
fn my_function() {
// Function body
}logging output will look like:
“Program log: Function my_function consumed 36 compute units”