httplog icon indicating copy to clipboard operation
httplog copied to clipboard

LogEntry should return a pointer

Open bronger opened this issue 1 year ago • 0 comments

httplog.LogEntry should return *slog.Logger instead of slog.Logger because then, the returned value implements interfaces for the slog API. Reason is that slog’s Logger methods need pointer receivers.

Note that *slog.Logger is used in slog’s own code all over the place, and even httplog’s LogEntry needs to de-reference in order to return a plain slog.Logger.

bronger avatar Mar 01 '24 20:03 bronger