log

package
v0.0.0-...-8655829 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 6 Imported by: 181

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

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

func IntoContext

func IntoContext(ctx context.Context, logger *slog.Logger) context.Context

func NewLogger

func NewLogger(opts *HandlerOptions) *slog.Logger

Types

type Handler

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

func NewHandler

func NewHandler(opts *HandlerOptions) *Handler

func (*Handler) Enabled

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

func (*Handler) Handle

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

type HandlerOptions struct {
	Name      string
	MinLevel  slog.Leveler
	AddSource bool
}

type Stack

type Stack []uintptr

func CaptureStack

func CaptureStack() *Stack

func (*Stack) Slice

func (s *Stack) Slice() []string

func (*Stack) String

func (s *Stack) String() string

Jump to

Keyboard shortcuts

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