stdlibx

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmitFunc

type EmitFunc func(level int, showStd bool, text string)

type LevelMapper

type LevelMapper func(text string, fallbackLevel int) int

type Option

type Option func(*Options)

func WithFlags

func WithFlags(flags int) Option

func WithLevelMapper

func WithLevelMapper(mapper LevelMapper) Option

func WithPrefix

func WithPrefix(prefix string) Option

func WithShowStd

func WithShowStd(show bool) Option

func WithTrimNewline

func WithTrimNewline(trim bool) Option

type Options

type Options struct {
	Prefix      string
	Flags       int
	ShowStd     bool
	TrimNewline bool
	LevelMapper LevelMapper
}

func DefaultOptions

func DefaultOptions() Options

func NormalizeOptions

func NormalizeOptions(opts []Option) Options

type Writer

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

func NewWriter

func NewWriter(level int, options Options, emit EmitFunc) *Writer

func (*Writer) SetShowStd

func (writer *Writer) SetShowStd(show bool)

func (*Writer) SetTrimNewline

func (writer *Writer) SetTrimNewline(trim bool)

func (*Writer) Write

func (writer *Writer) Write(data []byte) (int, error)

Jump to

Keyboard shortcuts

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