zerolog icon indicating copy to clipboard operation
zerolog copied to clipboard

MarshalZerologObject is not called on embedded structs

Open bertold opened this issue 2 years ago • 0 comments

I would like to suppress logging certain fields in particular struct. This works fine with the Interface() call when the struct is used directly and the struct implements the LogObjectMarshaler interface. However, if the same type is included in another struct, then the LogObjectMarshaler is not called on the embedded object.

For illustration see this sample on the Go Playground.

bertold avatar Oct 14 '23 20:10 bertold