hooks

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoHook

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

MongoHook logrus hook for writing logs into mongo collection

func NewMongoHook

func NewMongoHook(collection *mongo.Collection, opts ...MongoHookOption) (*MongoHook, error)

NewMongoHook returns new hook

func (*MongoHook) Fire

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

Fire hook

func (*MongoHook) Levels

func (hook *MongoHook) Levels() []logrus.Level

type MongoHookOption added in v1.0.0

type MongoHookOption func(*MongoHook)

MongoHookOption mongo hook option

func WithTimeout added in v1.0.0

func WithTimeout(timeout *time.Duration) MongoHookOption

Jump to

Keyboard shortcuts

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