MCPcopy
hub / github.com/go-chi/chi / WithLogEntry

Function WithLogEntry

middleware/logger.go:81–84  ·  view source on GitHub ↗

WithLogEntry sets the in-context LogEntry for a request.

(r *http.Request, entry LogEntry)

Source from the content-addressed store, hash-verified

79
80// WithLogEntry sets the in-context LogEntry for a request.
81func WithLogEntry(r *http.Request, entry LogEntry) *http.Request {
82 r = r.WithContext(context.WithValue(r.Context(), LogEntryCtxKey, entry))
83 return r
84}
85
86// LoggerInterface accepts printing to stdlib logger or compatible logger.
87type LoggerInterface interface {

Callers 1

RequestLoggerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected