pterm

package
v0.24.3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: MIT 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

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

func NewSlogHandler

func NewSlogHandler() *SlogHandler

NewSlogHandler returns a new logging handler that can be intrgrated with log/slog.

func (*SlogHandler) Enabled

func (s *SlogHandler) Enabled(ctx context.Context, level slog.Level) bool

Enabled returns true if the given level is enabled.

func (*SlogHandler) Handle

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

Handle handles the given record.

func (*SlogHandler) WithAttrs

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

WithAttrs returns a new handler with the given attributes.

func (*SlogHandler) WithGroup

func (s *SlogHandler) WithGroup(name string) slog.Handler

WithGroup is not yet supported.

type Writer added in v0.21.0

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

func NewWriter added in v0.21.0

func NewWriter(printer pterm.PrefixPrinter) *Writer

func (*Writer) Write added in v0.21.0

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

Jump to

Keyboard shortcuts

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