Documentation ¶
Index ¶
- func InitWithCores(cores []zapcore.Core)
- func NewContext(ctx context.Context, fields ...zapcore.Field) context.Context
- func NewContextWithGeneratedID(ctx context.Context) context.Context
- func NewContextWithID(ctx context.Context, id string) context.Context
- func ReadContextID(ctx context.Context) string
- func WithContext(ctx context.Context) *zap.Logger
- func WithResponseTimeLogging(next http.Handler) http.Handler
- func WithResponseTimeLoggingFunc(next func(w http.ResponseWriter, r *http.Request)) http.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitWithCores ¶
InitWithCores is used to set up a new logger
func NewContext ¶
NewContext returns a context has a zap logger with the extra fields added
func NewContextWithGeneratedID ¶
NewContextWithGeneratedID returns a context with a generated id with a zap logger and an id field
func NewContextWithID ¶
NewContextWithID returns a context which has a zap logger and an id field
func ReadContextID ¶
ReadContextID returns the context's id or "undefined"
func WithContext ¶
WithContext returns a zap logger with as much context as possible
func WithResponseTimeLogging ¶
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.
Click to show internal directories.
Click to hide internal directories.