slognil

package module
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2024 License: ISC Imports: 2 Imported by: 1

README

slognil

Discard handler for slog. Want do discard all logs? Use this handler, without bothering with levels (useful for tests):

logger := slognil.NewLogger()

Documentation

Index

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) WithAttrs

func (h Handler) WithAttrs(attrs []slog.Attr) slog.Handler

func (Handler) WithGroup

func (h Handler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL