test

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hook

type Hook struct {
	Entries []*logrus.Entry
}

test.Hook is a hook designed for dealing with logs in test scenarios.

func NewGlobal

func NewGlobal() *Hook

Installs a test hook for the global logger.

func NewLocal

func NewLocal(logger *logrus.Logger) *Hook

Installs a test hook for a given local logger.

func NewNullLogger

func NewNullLogger() (*logrus.Logger, *Hook)

Creates a discarding logger and installs the test hook.

func (*Hook) Fire

func (t *Hook) Fire(e *logrus.Entry) error

func (*Hook) LastEntry

func (t *Hook) LastEntry() (l *logrus.Entry)

LastEntry returns the last entry that was logged or nil.

func (*Hook) Levels

func (t *Hook) Levels() []logrus.Level

func (*Hook) Reset

func (t *Hook) Reset()

Reset removes all Entries from this test hook.

Jump to

Keyboard shortcuts

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