Help us shape the future of Go! Take the 2026 Go Developer Survey

logging

package
v0.26.4 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SlogHandler added in v0.26.0

type SlogHandler struct {
	MessagePrefix string
	// contains filtered or unexported fields
}

SlogHandler forwards log/slog records to tflog, so that records the meshStack CLI's pkg/ packages write through the slog default logger land in the terraform log stream.

It carries more than debugging output, because pkg/ reports to a front end in exactly two ways — an error return, or an slog record. A warning it raises therefore reaches a practitioner as a TF_LOG=WARN log line and never as a warning diagnostic in plan output.

func (SlogHandler) Enabled added in v0.26.0

func (h SlogHandler) Enabled(context.Context, slog.Level) bool

Enabled passes everything through, because tflog owns the level: TF_LOG decides what terraform keeps, and a filter here would hide records the practitioner asked for. The cost is that every record is handled, including the ones TF_LOG drops, so nothing here may render an attribute.

func (SlogHandler) Handle added in v0.26.0

func (h SlogHandler) Handle(ctx context.Context, record slog.Record) error

func (SlogHandler) WithAttrs added in v0.26.0

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

func (SlogHandler) WithGroup added in v0.26.0

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

Jump to

Keyboard shortcuts

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