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.
httplog.LogEntry
should return*slog.Logger
instead ofslog.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’sLogEntry
needs to de-reference in order to return a plainslog.Logger
.