logging

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2018 License: Apache-2.0 Imports: 7 Imported by: 38

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitWithCores

func InitWithCores(cores []zapcore.Core)

InitWithCores is used to set up a new logger

func NewContext

func NewContext(ctx context.Context, fields ...zapcore.Field) context.Context

NewContext returns a context has a zap logger with the extra fields added

func NewContextWithGeneratedID

func NewContextWithGeneratedID(ctx context.Context) context.Context

NewContextWithGeneratedID returns a context with a generated id with a zap logger and an id field

func NewContextWithID

func NewContextWithID(ctx context.Context, id string) context.Context

NewContextWithID returns a context which has a zap logger and an id field

func ReadContextID

func ReadContextID(ctx context.Context) string

ReadContextID returns the context's id or "undefined"

func WithContext

func WithContext(ctx context.Context) *zap.Logger

WithContext returns a zap logger with as much context as possible

func WithResponseTimeLogging

func WithResponseTimeLogging(next http.Handler) http.Handler

WithResponseTimeLogging wraps around the given handler, providing response time logging

func WithResponseTimeLoggingFunc added in v0.4.7

func WithResponseTimeLoggingFunc(
	next func(w http.ResponseWriter, r *http.Request),
) http.HandlerFunc

WithResponseTimeLoggingFunc wraps around the http request handler function, providing response time logging.

Types

This section is empty.

Jump to

Keyboard shortcuts

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