elichai / log-derive

A procedural macro for auto logging output of functions
https://docs.rs/log-derive
Apache License 2.0
189 stars 12 forks source link

Choose which inputs to log #23

Open TedDriggs opened 4 years ago

TedDriggs commented 4 years ago

I'd like to use log-derive to log a specific input to this function, but I don't want to grab the other two arguments.

Ideally, I think I'd like to write:

    #[logfn_inputs(Trace, fmt = "Resolving {}", args(order))]
    pub fn resolve(
        &mut self,
        context: &'a ResolverContext<'a>,
        order: &'a MappedMainOrder,
    )

However, being able to skip arguments would also work. It's not quite as simple as being able to skip self since I also don't want to log the context. Is this something that's aligned with log-derive, or should I use a normal macro instead?