README ¶ slognil Discard handler for slog. Want do discard all logs? Use this handler, without bothering with levels (useful for tests): logger := slognil.NewLogger() Expand ▾ Collapse ▴ Documentation ¶ Index ¶ func NewLogger() *slog.Logger type Handler func (Handler) Enabled(context.Context, slog.Level) bool func (Handler) Handle(context.Context, slog.Record) error func (h Handler) WithAttrs(attrs []slog.Attr) slog.Handler func (h Handler) WithGroup(name string) slog.Handler Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func NewLogger ¶ added in v0.2.0 func NewLogger() *slog.Logger NewLogger returns a logger configured to use the nil handler. Types ¶ type Handler ¶ type Handler struct{} func (Handler) Enabled ¶ func (Handler) Enabled(context.Context, slog.Level) bool func (Handler) Handle ¶ func (Handler) Handle(context.Context, slog.Record) error func (Handler) WithAttrs ¶ func (h Handler) WithAttrs(attrs []slog.Attr) slog.Handler func (Handler) WithGroup ¶ func (h Handler) WithGroup(name string) slog.Handler Source Files ¶ View all Source files handler.go Click to show internal directories. Click to hide internal directories.