Go introduced any type, that is just an empty interface under the hood. I think it would be good to introduce Any() function in zerolog as well. Under the hood it will use the old Interface() function.
Example:
// before
log.Debug().Interface("params", p).Msg("charge request")
// after
log.Debug().Any("params", p).Msg("charge request")
It makes the line a bit shorter and, in my opinion, makes it more obvious of what it's going to log.
Also I don't propose to removeInterface() function, I propose to add a new function that's going to do the same thing that the old function did.
Go introduced
any
type, that is just an empty interface under the hood. I think it would be good to introduceAny()
function in zerolog as well. Under the hood it will use the oldInterface()
function.Example:
It makes the line a bit shorter and, in my opinion, makes it more obvious of what it's going to log.
Also I don't propose to remove
Interface()
function, I propose to add a new function that's going to do the same thing that the old function did.