logger

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(ctx context.Context, msg string, args ...any)

func Error

func Error(ctx context.Context, msg string, err error, args ...any)

func FromContext

func FromContext(ctx context.Context) *slog.Logger

func Info

func Info(ctx context.Context, msg string, args ...any)

func Initialize

func Initialize(debug, verbose bool)

func Warn

func Warn(ctx context.Context, msg string, args ...any)

func With

func With(ctx context.Context, args ...any) context.Context

func WithLogger

func WithLogger(ctx context.Context, logger *slog.Logger) context.Context

Types

type PrettyHandler

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

PrettyHandler is a custom slog.Handler for human-friendly CLI output

func NewPrettyHandler

func NewPrettyHandler(w io.Writer, opts *slog.HandlerOptions) *PrettyHandler

func (*PrettyHandler) Enabled

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

func (*PrettyHandler) Handle

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

func (*PrettyHandler) WithAttrs

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

func (*PrettyHandler) WithGroup

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

Jump to

Keyboard shortcuts

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