logging

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) *slog.Logger

func New

func New(cfg LoggerConfig) *slog.Logger

func ToContext

func ToContext(ctx context.Context, log *slog.Logger) context.Context

Types

type LoggerConfig

type LoggerConfig struct {
	Level      string
	Format     string
	WithSource bool
}

type PlainHandler

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

func NewPlainHandler

func NewPlainHandler(w io.Writer, level slog.Leveler) *PlainHandler

func (*PlainHandler) Enabled

func (h *PlainHandler) Enabled(_ context.Context, lvl slog.Level) bool

func (*PlainHandler) Handle

func (h *PlainHandler) Handle(_ context.Context, r slog.Record) error

func (*PlainHandler) WithAttrs

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

func (*PlainHandler) WithGroup

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

func (*PlainHandler) WithSource added in v0.0.34

func (h *PlainHandler) WithSource(b bool) *PlainHandler

func (*PlainHandler) WithTimestamp added in v0.0.34

func (h *PlainHandler) WithTimestamp(b bool) *PlainHandler

Jump to

Keyboard shortcuts

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