log

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pretty added in v1.8.5

func Pretty(entry *logrus.Entry) ([]byte, error)

Pretty formats a logrus entry like so: ``` 2019-02-11T16:02:02Z INFO pfs.API.InspectRepo {"request":{"repo":{"name":"images"}}} [] ```

Types

type FormatterFunc added in v1.8.5

type FormatterFunc func(entry *logrus.Entry) ([]byte, error)

FormatterFunc is a type alias for a function that satisfies logrus' `Formatter` interface

func (FormatterFunc) Format added in v1.8.5

func (f FormatterFunc) Format(entry *logrus.Entry) ([]byte, error)

Format proxies the closure in order to satisfy `logrus.Formatter`'s interface.

type Logger

type Logger interface {
	Log(request interface{}, response interface{}, err error, duration time.Duration)
	LogAtLevelFromDepth(request interface{}, response interface{}, err error, duration time.Duration, level logrus.Level, depth int)
}

Logger is a helper for emitting our grpc API logs

func NewLocalLogger added in v1.7.4

func NewLocalLogger(service string) Logger

NewLocalLogger creates a new logger for local testing (which does not report prometheus metrics)

func NewLogger

func NewLogger(service string) Logger

NewLogger creates a new logger

Jump to

Keyboard shortcuts

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