We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d259e4 commit 4feefdbCopy full SHA for 4feefdb
zapr.go
@@ -174,6 +174,14 @@ func zapIt(field string, val interface{}) zap.Field {
174
if marshaler, ok := val.(logr.Marshaler); ok {
175
field, val = invokeMarshaler(field, marshaler)
176
}
177
+ if keysAndValues, ok := val.(logr.KeysAndValues); ok {
178
+ return zap.Object(field, zapcore.ObjectMarshalerFunc(func(encoder zapcore.ObjectEncoder) error {
179
+ for _, keyAndValue := range keysAndValues {
180
+ encoder.AddReflected(keyAndValue.Key, keyAndValue.Value)
181
+ }
182
+ return nil
183
+ }))
184
185
return zap.Any(field, val)
186
187
0 commit comments