Redmage/log/nil_handler.go

14 lines
383 B
Go
Raw Normal View History

2024-04-06 01:22:00 +07:00
package log
import (
"context"
"log/slog"
)
type NullHandler struct{}
func (NullHandler) Enabled(context.Context, slog.Level) bool { return false }
func (NullHandler) Handle(context.Context, slog.Record) error { return nil }
func (nu NullHandler) WithAttrs([]slog.Attr) slog.Handler { return nu }
func (nu NullHandler) WithGroup(string) slog.Handler { return nu }