zap
zap copied to clipboard
Custom fields in log statement?
Hi, I'm wondering if you'd consider a PR for adding functionality to make it possible to add custom fields to the log statement? E.g. by having something like:
func WithCustomFields(logger *zap.Logger,
timeFormat string,
utc bool,
customFields ...func(c *gin.Context) zap.Field,
) gin.HandlerFunc {
...
Our use-case is that we need to log the return headers.
@maros7 this package https://github.com/things-go/gzap may meet you need.
See https://github.com/gin-contrib/zap#custom-zap-fields