You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would have been great to have an ability to skip certain arguments or all arguments altogether and also not have to have Debug implementation for not logged values.
Not sure yet how difficult it is to implement but in a perfect world it would have been possible to:
Choose to skip certain arguments.
Choose to skip all arguments.
Require Debug only if the value will be actually logged.
/// Logs errors at the `error` level. No log output for `Ok` variant.#[logcall(err = "error")]fndivide2(a:usize,b:usize) -> Result<usize,String>{if b == 0{Err("Division by zero".to_string())}else{Ok(a / b)}}
The text was updated successfully, but these errors were encountered:
Yes, I agree it's convenient to have an attribute config to skip some of the fields. Currently, you could skip all by denoting #[logcall(input = "")] to prevent it from outputting arguments, and also you could manually write the input format string to fine-grained control which arguments to print and using whether Debug/Display like#[logcall(input = "a = {a:?}")].
It would have been great to have an ability to skip certain arguments or all arguments altogether and also not have to have
Debug
implementation for not logged values.The reason being that not all arguments/returns can provide reasonable implementations of
Debug
. Docs of a similiar feature in tokio tracing: https://docs.rs/tracing/latest/tracing/attr.instrument.html#skipping-fieldsNot sure yet how difficult it is to implement but in a perfect world it would have been possible to:
Debug
only if the value will be actually logged.The text was updated successfully, but these errors were encountered: