xotel

package
v0.0.0-...-da7669f Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSeparator = "."

Variables

View Source
var DefaultEnabledLevels = []slog.Level{slog.LevelError, slog.LevelWarn}

Functions

func DefaultKeyBuilder

func DefaultKeyBuilder(groups []string, key string) string

Types

type Handler

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

func NewDefaultHandler

func NewDefaultHandler() *Handler

func NewHandler

func NewHandler(enabledLevels []slog.Level, keyBuilder KeyBuilder) *Handler

func (*Handler) Enabled

func (h *Handler) Enabled(_ 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

type KeyBuilder

type KeyBuilder func(groups []string, key string) string

Jump to

Keyboard shortcuts

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