stdiosink

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPalette = Palette{
	KeyColor:              color.New(color.FgGreen),
	ValColor:              color.New(color.FgHiWhite),
	TimeLightBgColor:      color.New(color.FgBlack),
	TimeDarkBgColor:       color.New(color.FgWhite),
	MsgLightBgColor:       color.New(color.FgBlack),
	MsgAbsentLightBgColor: color.New(color.FgHiBlack),
	MsgDarkBgColor:        color.New(color.FgHiWhite),
	MsgAbsentDarkBgColor:  color.New(color.FgWhite),
	DebugLevelColor:       color.New(color.FgMagenta),
	InfoLevelColor:        color.New(color.FgCyan),
	WarnLevelColor:        color.New(color.FgYellow),
	ErrorLevelColor:       color.New(color.FgRed),
	PanicLevelColor:       color.New(color.BgRed),
	FatalLevelColor:       color.New(color.BgHiRed, color.FgHiWhite),
	UnknownLevelColor:     color.New(color.FgMagenta),
}
View Source
var DefaultStdioOpts = StdioOpts{

	SkipUnchanged:  true,
	SortLongest:    true,
	TimeFormat:     time.Stamp,
	TruncateLength: 15,
	Truncates:      true,

	ColorFlag: "auto",
	LightBg:   false,
	Palette:   DefaultPalette,
}

Functions

This section is empty.

Types

type Palette

type Palette struct {
	KeyColor              *color.Color
	ValColor              *color.Color
	TimeLightBgColor      *color.Color
	TimeDarkBgColor       *color.Color
	MsgLightBgColor       *color.Color
	MsgAbsentLightBgColor *color.Color
	MsgDarkBgColor        *color.Color
	MsgAbsentDarkBgColor  *color.Color
	DebugLevelColor       *color.Color
	InfoLevelColor        *color.Color
	WarnLevelColor        *color.Color
	ErrorLevelColor       *color.Color
	PanicLevelColor       *color.Color
	FatalLevelColor       *color.Color
	UnknownLevelColor     *color.Color
}

func PaletteFrom

func PaletteFrom(pl config.TextPalette) (*Palette, error)

type Stdio

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

func NewStdio

func NewStdio(w io.Writer, opts StdioOpts) *Stdio

func (*Stdio) Receive

func (std *Stdio) Receive(ev *model.Event) error

type StdioOpts

type StdioOpts struct {
	Keep           map[string]struct{}
	Skip           map[string]struct{}
	SkipUnchanged  bool
	SortLongest    bool
	TimeFormat     string
	TruncateLength int
	Truncates      bool

	ColorFlag string
	LightBg   bool
	Palette   Palette
}

func StdioOptsFrom

func StdioOptsFrom(cfg config.Config) (StdioOpts, []error)

Jump to

Keyboard shortcuts

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