slog

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTraceHandler

func NewTraceHandler(w io.Writer, opts *slog.HandlerOptions, traceConfig *traceConfig) *traceHandler

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithHandlerOptions

func WithHandlerOptions(opt *slog.HandlerOptions) Option

WithHandlerOptions slog handler-options

func WithLevel

func WithLevel(lvl *slog.LevelVar) Option

WithLevel slog level

func WithOutput

func WithOutput(iow io.Writer) Option

WithOutput slog writer

func WithRecordStackTraceInSpan

func WithRecordStackTraceInSpan(recordStackTraceInSpan bool) Option

WithRecordStackTraceInSpan record stack track option

func WithTraceErrorSpanLevel

func WithTraceErrorSpanLevel(level slog.Level) Option

WithTraceErrorSpanLevel trace error span level option

type Writer

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

func NewWriter

func NewWriter(opts ...Option) *Writer

func (*Writer) Logger

func (w *Writer) Logger() *slog.Logger

func (*Writer) Printf

func (w *Writer) Printf(format string, v ...interface{})

func (*Writer) SetLvel

func (w *Writer) SetLvel(level slog.Level)

func (*Writer) SetOutput

func (w *Writer) SetOutput(writer io.Writer)

Jump to

Keyboard shortcuts

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