logger

package
v0.0.0-...-d09eed2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraceIDAttr = "trace_id"
	SpanIDAttr  = "span_id"
)

Variables

Functions

func Init

func Init(opts Options)

func With

func With(args ...any) *slog.Logger

func WithGroup

func WithGroup(name string) *slog.Logger

Types

type ContextHandler

type ContextHandler struct {
	slog.Handler
}

func (ContextHandler) Handle

func (h ContextHandler) Handle(ctx context.Context, r slog.Record) error

func (ContextHandler) WithAttrs

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

func (ContextHandler) WithGroup

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

type Options

type Options struct {
	Development bool
}

Jump to

Keyboard shortcuts

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