log

package
v7.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoContext

func NoContext() *logrus.Logger

NoContext provides logrus.StandardLogger()

func WithContext

func WithContext(ctx context.Context) *logrus.Entry

WithContext provides a *logrus.Entry with the proper "correlation-id" field.

"[MISSING]" will be used when ctx has no value for KeyCorrelationID

func WithError

func WithError(ctx context.Context, err error) *logrus.Entry

WithError decorates logrus.WithError with the proper "correlation-id"

func WithField

func WithField(ctx context.Context, key string, value interface{}) *logrus.Entry

WithField decorates logrus.WithField with the proper "correlation-id"

func WithFields

func WithFields(ctx context.Context, f Fields) *logrus.Entry

WithFields decorates logrus.WithFields with the proper "correlation-id"

func WrapEntry

func WrapEntry(ctx context.Context, e *logrus.Entry) *logrus.Entry

WrapEntry adds the proper "correlation-id" field to the provided *logrus.Entry

Types

type Fields

type Fields map[string]interface{}

Fields type, an helper to avoid importing logrus.Fields

Jump to

Keyboard shortcuts

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