logplex

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogfFromWriter

func LogfFromWriter(w io.Writer) func(string, ...any)

func LogfWriter

func LogfWriter(logf func(string, ...any)) io.Writer

Types

type Logplex

type Logplex struct {
	Sink io.Writer

	// if nil, all lines go to Drain
	Split func(line []byte) (key, message []byte)
	// contains filtered or unexported fields
}

func (*Logplex) Flush

func (lp *Logplex) Flush() error

Flush flushes the any underlying buffered contents to any corresponding sink.

The contents flushed may not be a complete line, or have enough data to determine the proper sink and instead send to Sink.

Flush should only be called when no more data will be written to Write.

func (*Logplex) Unwatch

func (lp *Logplex) Unwatch(prefix string)

func (*Logplex) Watch

func (lp *Logplex) Watch(prefix string, w io.Writer)

func (*Logplex) Write

func (lp *Logplex) Write(p []byte) (int, error)

Write writes p to the underlying buffer and flushes each newline to their corresponding sinks.

Jump to

Keyboard shortcuts

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