tracesink

package
v3.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Func

type Func func(context.Context, string)

Func is a TraceSink that calls a function with the trace message.

func (Func) Put

func (f Func) Put(ctx context.Context, msg string)

Put calls the function with the trace message.

type Interface

type Interface interface {
	Put(context.Context, string)
}

func NewNop

func NewNop() Interface

NewNop returns a new NopTraceSink object. The constructor is provided for consistency.

func NewSlog

func NewSlog(l SlogLogger) Interface

NewSlog returns a new ErrorSink that logs errors using the provided slog.Logger

type Nop

type Nop struct{}

Nop is an ErrorSink that does nothing. It does not require any initialization, so the zero value can be used.

func (Nop) Put

func (Nop) Put(context.Context, string)

Put for NopTraceSink does nothing.

type SlogLogger

type SlogLogger interface {
	Log(context.Context, slog.Level, string, ...any)
}

Jump to

Keyboard shortcuts

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