sink

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Enabled specifies that a feature is enabled.
	Enabled = true
	// Disabled specifies that a feature is disabled.
	Disabled = false

	// DefaultTimeFormat is the default time format used by the sink.
	DefaultTimeFormat = event.HumanTimeFormat
)

Functions

func NewChanWriterAt

func NewChanWriterAt(
	src source.Source,
	out chan source.Event,
) io.WriterAt

NewChanWriterAt ...

func NewOut

func NewOut(name string, writer io.WriteCloser) chan string

NewOut ...

Types

type Config

type Config struct {
	AutoResize       *bool          `yaml:"auto_resize,omitempty"`
	Color            *bool          `yaml:"color,omitempty"`
	Columns          []string       `yaml:"columns,omitempty"`
	ConsistentColors *bool          `yaml:"consistent_colors,omitempty"`
	Expand           *bool          `yaml:"expand,omitempty"`
	Highlight        *bool          `yaml:"highlight,omitempty"`
	MultiLine        *bool          `yaml:"multi_line,omitempty"`
	LevelMeter       *bool          `yaml:"level_meter,omitempty"`
	Theme            *theme2.Theme  `yaml:"theme,omitempty"`
	Layout           *layout.Layout `yaml:"-"`
	TimeFormat       *string        `yaml:"time_format,omitempty"`
	TTY              bool           `yaml:"-"`
	Width            *uint          `yaml:"width,omitempty"`
	Wrap             *bool          `yaml:"wrap,omitempty"`
	Out              *os.File       `yaml:"-"`
}

Config ...

func DefaultConfig added in v1.3.7

func DefaultConfig() Config

DefaultConfig returns default configuration for the sink.

func (*Config) EffectiveIsTTY

func (config *Config) EffectiveIsTTY() bool

EffectiveIsTTY ...

func (*Config) EffectiveTerminalWidth

func (config *Config) EffectiveTerminalWidth() uint

EffectiveTerminalWidth ...

func (*Config) PopulateMissing added in v1.1.0

func (config *Config) PopulateMissing(other Config) *Config

PopulateMissing ...

type Sink

type Sink interface {
	// Init called prior to the beginning of logging.
	Init(sources []*source.Source)
	// Accept consumes an event, typically for display.
	Accept(event event.SinkEvent) error
}

Sink of events. Responsible for consuming an event.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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