You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If called from a Logger method, the first argument is the context
// passed to that method, or context.Background() if nil was passed
// or the method does not take a context.
...
Enabled(context.Context, Level) bool
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What did you do?
Look at the source code: https://cs.opensource.google/go/go/+/refs/tags/go1.21rc2:src/log/slog/logger.go;l=209-210
What did you expect to see?
This
if
must be executed before callingl.Enabled(ctx)
: https://cs.opensource.google/go/go/+/refs/tags/go1.21rc2:src/log/slog/logger.go;l=222-224What did you see instead?
Current implementation violates current doc. https://pkg.go.dev/log/slog#Handler says:
The text was updated successfully, but these errors were encountered: