Add augmented logger to the context to pass it down. (#1192)

This commit is contained in:
Markus Thömmes 2020-04-06 17:21:27 +02:00 committed by GitHub
parent c09083a601
commit 83edd9f30d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -109,11 +109,11 @@ func (r *reconciler) convert(
out := outZygote.DeepCopyObject().(ConvertibleObject) out := outZygote.DeepCopyObject().(ConvertibleObject)
hubGVK := inGVK.GroupKind().WithVersion(conv.HubVersion) hubGVK := inGVK.GroupKind().WithVersion(conv.HubVersion)
logger = logger.With( ctx = logging.WithLogger(ctx, logger.With(
zap.String("inputType", formatGVK(inGVK)), zap.String("inputType", formatGVK(inGVK)),
zap.String("outputType", formatGVK(outGVK)), zap.String("outputType", formatGVK(outGVK)),
zap.String("hubType", formatGVK(hubGVK)), zap.String("hubType", formatGVK(hubGVK)),
) ))
// TODO(dprotaso) - potentially error on unknown fields // TODO(dprotaso) - potentially error on unknown fields
if err = json.Unmarshal(inRaw.Raw, &in); err != nil { if err = json.Unmarshal(inRaw.Raw, &in); err != nil {