logger

package
v0.0.0-...-cf015e3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogMemStats

func LogMemStats(ctx context.Context, msg string, logger *slog.Logger)

func New

func New(cfg Config) *slog.Logger

Types

type Config

type Config struct {
	Level       string `json:"level"`
	ContextKeys []string
}

type LogHandler

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

func (LogHandler) Enabled

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

func (LogHandler) Handle

func (h LogHandler) Handle(ctx context.Context, record slog.Record) error

func (LogHandler) WithAttrs

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

func (LogHandler) WithGroup

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

Jump to

Keyboard shortcuts

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