Fields duplicate instead of overriding
I do something like httplog.LogEntrySetField(ctx, "step", step) and then oplog := httplog.LogEntry(ctx) to get the logger for that layer as the request goes through my app, with step being either "handler", "service" or "storage".
I kinda expected the method to override this field as the key name remains the same, but instead I just get step: "handler" step: "service" step: "storage" in logs.
What am I doing wrong?
~~Should I use LogEntrySetFields with a copy of the context as argument to "preserve" the original for the next layer?~~ Doesn't seem to work based on a quick test, at least without some voodoo to build a copy from scratch.
This sounds like an implementation detail, could you provide more code?
Closing since v3 was merged.
https://github.com/go-chi/httplog/pull/52