Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LogEntry should return a pointer #40

Open
bronger opened this issue Mar 1, 2024 · 0 comments
Open

LogEntry should return a pointer #40

bronger opened this issue Mar 1, 2024 · 0 comments

Comments

@bronger
Copy link

bronger commented Mar 1, 2024

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 bronger changed the title LogEntry shoudl return a pointer LogEntry should return a pointer Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant