Skip to content

Commit

Permalink
logging: use duration stringer
Browse files Browse the repository at this point in the history
this commit uses the duration stringer to pretty print the time it takes
or a http handler to complete

Signed-off-by: ldelossa <ldelossa@redhat.com>
  • Loading branch information
ldelossa authored and ldelossa committed Sep 22, 2020
1 parent e45c1e1 commit 15f3755
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion httptransport/logginghandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func LoggingHandler(next http.Handler) http.HandlerFunc {
Str("method", r.Method).
Str("request uri", r.RequestURI).
Int("status", lrw.StatusCode).
Float64("elapsed time (md)", float64(time.Since(start).Nanoseconds())*1e-6).
Str("elapsed time (md)", time.Since(start).String()).
Msg("handled HTTP request")
}
}

0 comments on commit 15f3755

Please sign in to comment.