slogctx

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: BSD-2-Clause Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(ctx context.Context, msg string, args ...any)

func Error

func Error(ctx context.Context, msg string, args ...any)

func Info

func Info(ctx context.Context, msg string, args ...any)

func New

func New(handler slog.Handler) *slog.Logger

func ReplaceAttr added in v0.0.2

func ReplaceAttr(groups []string, a slog.Attr) slog.Attr

func Warn

func Warn(ctx context.Context, msg string, args ...any)

func WithValue

func WithValue(parent context.Context, key string, val any) context.Context

Types

type Handler

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

func (Handler) Enabled

func (h Handler) Enabled(ctx context.Context, level slog.Level) bool

func (Handler) Handle

func (h Handler) Handle(ctx context.Context, record 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

Jump to

Keyboard shortcuts

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