instrumentation

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(debug bool) *slog.Logger

Types

type Buffer

type Buffer []byte

This implementation is adapted from the unexported type buffer in src/log/slog/internal/buffer/buffer.go.

func NewBuffer

func NewBuffer() *Buffer

func (*Buffer) Free

func (b *Buffer) Free()

func (*Buffer) Len

func (b *Buffer) Len() int

func (*Buffer) Reset

func (b *Buffer) Reset()

func (*Buffer) SetLen

func (b *Buffer) SetLen(n int)

func (*Buffer) String

func (b *Buffer) String() string

func (*Buffer) Write

func (b *Buffer) Write(p []byte) (int, error)

func (*Buffer) WriteByte

func (b *Buffer) WriteByte(c byte) error

func (*Buffer) WriteString

func (b *Buffer) WriteString(s string) (int, error)

type Options

type Options struct {
	// Level reports the minimum level to log.
	// Levels with lower levels are discarded.
	// If nil, the Handler uses [slog.LevelInfo].
	Level slog.Leveler

	// AddSource reports whether to add the source code location of the
	// log statement to the output.
	AddSource bool
}

type PrettyHandler

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

func (*PrettyHandler) Enabled

func (handler *PrettyHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*PrettyHandler) Handle

func (handler *PrettyHandler) Handle(ctx context.Context, record slog.Record) error

func (*PrettyHandler) WithAttrs

func (handler *PrettyHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*PrettyHandler) WithGroup

func (handler *PrettyHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

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