logrus: github.com/sirupsen/logrus/hooks/null Index | Files

package null

import "github.com/sirupsen/logrus/hooks/null"

Index

Package Files

null.go

func NewNullLogger Uses

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

NewNullLogger creates a discarding logger and installs the test hook.

type Hook Uses

type Hook struct {
    // Entries is an array of all entries that have been received by this hook.
    // For safe access, use the AllEntries() method, rather than reading this
    // value directly.
    Entries []*logrus.Entry
    // contains filtered or unexported fields
}

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

func NewGlobal Uses

func NewGlobal() *Hook

NewGlobal installs a test hook for the global logger.

func NewLocal Uses

func NewLocal(logger *logrus.Logger) *Hook

NewLocal installs a test hook for a given local logger.

func (*Hook) AllEntries Uses

func (t *Hook) AllEntries() []*logrus.Entry

AllEntries returns all entries that were logged.

func (*Hook) Fire Uses

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

func (*Hook) LastEntry Uses

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

LastEntry returns the last entry that was logged or nil.

func (*Hook) Levels Uses

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

func (*Hook) Reset Uses

func (t *Hook) Reset()

Reset removes all Entries from this test hook.

Package null imports 3 packages (graph). Updated 2017-05-18. Refresh now. Tools for package owners.