(c *routing.Context)
| 24 | ) |
| 25 | |
| 26 | func BuildContext(c *routing.Context) *Context { |
| 27 | requestID := string(c.Request.Header.Peek(api.HeaderXRequestID)) |
| 28 | if len(requestID) == 0 { |
| 29 | requestID = id.GetRequestID() |
| 30 | } |
| 31 | return &Context{ |
| 32 | RequestID: requestID, |
| 33 | Logger: logs.NewLogger().WithField("request_id", requestID), |
| 34 | Context: c, |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | func (c *Context) WriteWithErrorLog(msg string) { |
| 39 | c.Logger.Error(msg) |
no test coverage detected