log

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 4 Imported by: 33

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxWriterBuffer = 512 * 1024

MaxWriterBuffer specifies how big the writer buffer can get before killing the writer.

View Source
var WriterGroup = NewMirrorWriter()

WriterGroup is the global writer group for logs to output to

Functions

This section is empty.

Types

type MirrorWriter

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

MirrorWriter implements a WriteCloser which syncs incoming bytes to multiple [buffered] WriteClosers. They can be added with AddWriter().

func NewMirrorWriter

func NewMirrorWriter() *MirrorWriter

NewMirrorWriter initializes and returns a MirrorWriter.

func (*MirrorWriter) Active

func (mw *MirrorWriter) Active() (active bool)

Active returns if there is at least one Writer attached to this MirrorWriter

func (*MirrorWriter) AddWriter

func (mw *MirrorWriter) AddWriter(w io.WriteCloser)

AddWriter attaches a new WriteCloser to this MirrorWriter. The new writer will start getting any bytes written to the mirror.

func (*MirrorWriter) Close

func (mw *MirrorWriter) Close() error

Close closes the MirrorWriter

func (*MirrorWriter) Write

func (mw *MirrorWriter) Write(b []byte) (int, error)

Write broadcasts the written bytes to all Writers.

Jump to

Keyboard shortcuts

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