logger

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2019 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FallbackLogDevice = os.Stdout

FallbackLogDevice defines the fallback destination for when _GOLLUM_ is unavailable / not used

Functions

func NewConsoleFormatter

func NewConsoleFormatter() *prefixed.TextFormatter

NewConsoleFormatter returns a a ConsoleFormatter reference

Types

type LogrusHookBuffer

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

LogrusHookBuffer implements logrus.Hook and is used to pools log messages during startup when the desired log destination (_GOLLUM_ stream or fallbackLogDevice) is not yet available or known. During normal operation it relays messages to targetHook and/or targetWriter.

func NewLogrusHookBuffer

func NewLogrusHookBuffer() LogrusHookBuffer

NewLogrusHookBuffer returns a LogrusHookBuffer instance

func (*LogrusHookBuffer) Fire

func (lhb *LogrusHookBuffer) Fire(logrusEntry *logrus.Entry) error

Fire and Levels() implement the logrus.Hook interface.

func (*LogrusHookBuffer) Levels

func (lhb *LogrusHookBuffer) Levels() []logrus.Level

Levels and Fire() implement the logrus.Hook interface

func (*LogrusHookBuffer) Purge

func (lhb *LogrusHookBuffer) Purge()

Purge sends stored messages to targetHook and/or targetWriter and empties the buffer.

func (*LogrusHookBuffer) SetTargetHook

func (lhb *LogrusHookBuffer) SetTargetHook(hook logrus.Hook)

SetTargetHook sets the logrus hook to whose .Fire() method messages should be relayed

func (*LogrusHookBuffer) SetTargetWriter

func (lhb *LogrusHookBuffer) SetTargetWriter(writer io.Writer)

SetTargetWriter sets the io.Writer where messages should be written

Jump to

Keyboard shortcuts

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