Skip to content

Commit

Permalink
Add logger, endpoint and handler name to response to use in middlewares
Browse files Browse the repository at this point in the history
  • Loading branch information
stevededalus committed Mar 30, 2017
1 parent 40b312b commit 4fe8341
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion runtime/server_http_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ type ServerHTTPResponse struct {
pendingBodyObj interface{}
pendingStatusCode int

StatusCode int
Logger zap.Logger

StatusCode int
EndpointName string
HandlerName string
}

// NewServerHTTPResponse is helper function to alloc ServerHTTPResponse
Expand All @@ -56,6 +60,11 @@ func NewServerHTTPResponse(
responseWriter: w,
StatusCode: 200,
metrics: req.metrics,

Logger: req.Logger,

EndpointName: req.EndpointName,
HandlerName: req.HandlerName,
}

return res
Expand Down

0 comments on commit 4fe8341

Please sign in to comment.