(ctx context.Context, old, newObj interface{})
| 10 | ) |
| 11 | |
| 12 | func 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 | } |
no test coverage detected