slogtestlog

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: MIT Imports: 8 Imported by: 0

README

slogtestlog

Test log for Golang where programme uses slog

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestNew added in v0.0.2

func TestNew(t *testing.T)

Types

type TestLog

type TestLog struct {
	// contains filtered or unexported fields
}

func New

func New() *TestLog

func (*TestLog) Enabled

func (h *TestLog) Enabled(_ context.Context, level slog.Level) bool

func (*TestLog) Handle

func (h *TestLog) Handle(context context.Context, record slog.Record) error

func (*TestLog) Read

func (h *TestLog) Read() []string

func (*TestLog) Reset

func (h *TestLog) Reset()

func (*TestLog) WithAttrs added in v0.0.2

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

I have no idea what these functions are supposed to do But conforming to interfaces is required here. Someone smarter might be able to tell me.

func (*TestLog) WithGroup added in v0.0.2

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

Jump to

Keyboard shortcuts

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