termlog

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Overview

Package termlog renders slog records as colored, human-readable terminal lines.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler is a slog.Handler that produces colored, human-readable output.

Non-verbose (Info+): focuses on scenario progress — clean, minimal. Verbose (Debug): includes component tags and structured attrs.

func NewHandler

func NewHandler(w io.Writer, verbose bool) *Handler

NewHandler renders to w, in colour only where colour is read as colour: a run redirected to a file, or reported through go test, would otherwise carry escape sequences into text somebody reads later.

func (*Handler) Enabled

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

func (*Handler) Handle

func (h *Handler) Handle(_ 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

Jump to

Keyboard shortcuts

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