logger

package
v0.0.0-...-7e2b890 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(debug bool) *slog.Logger

New creates a new slog logger with colored output when stdout is a TTY, and structured JSON otherwise.

Types

type ColoredHandler

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

ColoredHandler is a slog.Handler that writes colored, human-readable logs.

func NewColoredHandler

func NewColoredHandler(w io.Writer, opts *slog.HandlerOptions) *ColoredHandler

func (*ColoredHandler) Enabled

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

func (*ColoredHandler) Handle

func (h *ColoredHandler) Handle(_ context.Context, r slog.Record) error

func (*ColoredHandler) WithAttrs

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

func (*ColoredHandler) WithGroup

func (h *ColoredHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

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