logmw

package
v0.0.0-...-83625b3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CategoryFormatError       = "format error"
	CategoryValidationFailure = "validation failure"
	CategoryTracing           = "tracing"
	CategoryInputError        = "input error"
)
View Source
const (
	MiddlewareDependencyLog = "*logmw.LoggerMiddleware"
)

Variables

This section is empty.

Functions

func Debug

func Debug(r *http.Request, component, category interface{}) log.Logger

func Error

func Error(r *http.Request, component, category interface{}) log.Logger

func Info

func Info(r *http.Request, component, category interface{}) log.Logger

func Update

func Update(r *http.Request, logger log.Logger) *http.Request

func Warn

func Warn(r *http.Request, component, category interface{}) log.Logger

Types

type LoggerMiddleware

type LoggerMiddleware struct {
	middleware.NoDependencies
	// contains filtered or unexported fields
}

LoggerMiddleware injects a logger and a per request log buffer into the request context.

func New

func New(logger log.Logger) *LoggerMiddleware

func (*LoggerMiddleware) Wrap

func (lm *LoggerMiddleware) Wrap(next http.Handler) http.Handler

Jump to

Keyboard shortcuts

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