Macro entering

Source
entering!() { /* proc-macro */ }
Expand description

Log entry into a function/method.

This is a convenience macro that can be used to log entry into to a function/method. It can be used without an alternative message. A possible use is to provide the function/method’s parameters to track what is being passed-in.

If no alternative message is provided, then the default message, “Entry”, is used.

A LogEntry is created with a log level of FINER, that is then logged.

§Parameters

§Examples

 #[logger]
 pub fn add_student(name: String, age: u8) {
     entering!("name: {name}, age: {age}");
 }

 fn main(){
     let name = "Mary Jane Thompson".to_string();
     let age = 18;

     add_student(name, age);
 }

Output:

|flogging->add_student| [FINER  ] Entry: (name: Mary Jane Thompson, age: 18)