6cf6f95f58
CodeQL / Analyze (push) Has been cancelled
Sync to Gitee / Run (push) Has been cancelled
Go / build & test (1.25.x) (push) Has been cancelled
Go / build & test (1.26.x) (push) Has been cancelled
Lint / resolve module (push) Has been cancelled
Lint / lint module (push) Has been cancelled
16 lines
525 B
Go
16 lines
525 B
Go
package log
|
|
|
|
import (
|
|
"context"
|
|
"log/slog"
|
|
)
|
|
|
|
// discardHandler drops all records. It mirrors discardHandler{} from go1.24
|
|
// while keeping the module compatible with go1.22.
|
|
type discardHandler struct{}
|
|
|
|
func (discardHandler) Enabled(context.Context, slog.Level) bool { return false }
|
|
func (discardHandler) Handle(context.Context, slog.Record) error { return nil }
|
|
func (h discardHandler) WithAttrs([]slog.Attr) slog.Handler { return h }
|
|
func (h discardHandler) WithGroup(string) slog.Handler { return h }
|