MCPcopy
hub / github.com/argoproj/argo-workflows / LogChanges

Function LogChanges

util/diff/diff.go:12–20  ·  view source on GitHub ↗
(ctx context.Context, old, newObj interface{})

Source from the content-addressed store, hash-verified

10)
11
12func LogChanges(ctx context.Context, old, newObj interface{}) {
13 logger := logging.RequireLoggerFromContext(ctx)
14 // Note: We don't have a direct equivalent to log.IsLevelEnabled(log.DebugLevel)
15 // The logger will handle level filtering internally
16 a, _ := json.Marshal(old)
17 b, _ := json.Marshal(newObj)
18 patch, _ := jsonpatch.CreateMergePatch(a, b)
19 logger.WithField("patch", string(patch)).Debug(ctx, "Log changes patch")
20}

Callers 2

persistUpdatesMethod · 0.92
NewControllerFunction · 0.92

Calls 4

RequireLoggerFromContextFunction · 0.92
DebugMethod · 0.65
WithFieldMethod · 0.65
MarshalMethod · 0.45

Tested by

no test coverage detected