logrus_stack

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2017 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStackHook

func NewStackHook(options logrus_mate.Options) (hook logrus.Hook, err error)

Types

type LogrusStackHook

type LogrusStackHook struct {
	// Set levels to CallerLevels for which "caller" value may be set,
	// providing a single frame of stack.
	CallerLevels []logrus.Level

	// Set levels to StackLevels for which "stack" value may be set,
	// providing the full stack (minus logrus).
	StackLevels []logrus.Level
}

LogrusStackHook is an implementation of logrus.Hook interface.

func NewHook

func NewHook(callerLevels []logrus.Level, stackLevels []logrus.Level) LogrusStackHook

NewHook is the initializer for LogrusStackHook{} (implementing logrus.Hook). Set levels to callerLevels for which "caller" value may be set, providing a single frame of stack. Set levels to stackLevels for which "stack" value may be set, providing the full stack (minus logrus).

func StandardHook

func StandardHook() LogrusStackHook

StandardHook is a convenience initializer for LogrusStackHook{} with default args.

func (LogrusStackHook) Fire

func (hook LogrusStackHook) Fire(entry *logrus.Entry) error

Fire is called by logrus when something is logged.

func (LogrusStackHook) Levels

func (hook LogrusStackHook) Levels() []logrus.Level

Levels provides the levels to filter.

Jump to

Keyboard shortcuts

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