WithLogEntry sets the in-context LogEntry for a request.
(r *http.Request, entry LogEntry)
| 79 | |
| 80 | // WithLogEntry sets the in-context LogEntry for a request. |
| 81 | func 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. |
| 87 | type LoggerInterface interface { |