Skip to content

Commit

Permalink
add more structure to response logging (#149)
Browse files Browse the repository at this point in the history
align gRPC logging with HTTP

Co-authored-by: worldtiki <[email protected]>
  • Loading branch information
erodewald and worldtiki authored Mar 5, 2021
1 parent b6fc0fb commit 5720ca2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/warmup/warmup.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ func (w Warmup) HTTPWarmupWorker(wg *sync.WaitGroup, requests <-chan http.Reques
*requestsSentCounter++

if resp.StatusCode/100 == 2 {
log.Printf("%s response for %s %d ms: %v", resp.Type, request.Path, resp.Duration/time.Millisecond, resp.StatusCode)
log.Printf("🟢 %s response\t%d ms\t%v\t%s\t%s", resp.Type, resp.Duration/time.Millisecond, resp.StatusCode, request.Method, request.Path)
} else {
log.Printf("🔴 %s response for %s %d ms: %v", resp.Type, request.Path, resp.Duration/time.Millisecond, resp.StatusCode)
log.Printf("🔴 %s response\t%d ms\t%v\t%s\t%s", resp.Type, resp.Duration/time.Millisecond, resp.StatusCode, request.Method, request.Path)
}
}
}
Expand All @@ -107,7 +107,7 @@ func (w Warmup) GrpcWarmupWorker(wg *sync.WaitGroup, requests <-chan grpc.Reques
} else {
*requestsSentCounter++

log.Printf("%s response for %s %d ms", resp.Type, request.ServiceMethod, resp.Duration/time.Millisecond)
log.Printf("🟢 %s response\t%d ms %s", resp.Type, resp.Duration/time.Millisecond, request.ServiceMethod)
}

}
Expand Down

0 comments on commit 5720ca2

Please sign in to comment.