logger

package
v0.0.0-...-7082fca Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const LoggerCtxKey ctxKeyLogger = 0

LoggerCtxKey is the key that holds the unique logger ID in a context.

Variables

View Source
var (
	// ErrNoLoggerInContext is an error that's returned in case we try
	// to fetch logger from a context and it's not existing there
	ErrNoLoggerInContext = errors.New("logger cannot be found in context")
)

Functions

func GetContext

func GetContext(ctx context.Context) (zerolog.Logger, error)

GetContext returns a zerolog.Logger from a context

func Init

func Init(level string) error

Init initializing zerolog with the given configuration

func StoreContext

func StoreContext(ctx context.Context, lg zerolog.Logger) context.Context

StoreContext stores a zerolog `Logger` in a context and returns the new context

Types

This section is empty.

Jump to

Keyboard shortcuts

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