bufferhook

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 2, 2018 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferHook

type BufferHook struct {
	bytes.Buffer
	// contains filtered or unexported fields
}

BufferHook is a logrus hook to cache log messages into a buffer to be used in reporting later on. As bytes.Buffer is included in this struct all methods of it can be used.

func New

func New(level logrus.Level) *BufferHook

New creates a new BufferHook instance

func (*BufferHook) Fire

func (b *BufferHook) Fire(e *logrus.Entry) error

Fire retrieves the event and generates the log line (interface logrus.Hook)

func (BufferHook) Levels

func (b BufferHook) Levels() []logrus.Level

Levels returns the enabled levels for this hook (interface logrus.Hook)

Jump to

Keyboard shortcuts

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