Skip to content

Commit

Permalink
Change to use time.Since
Browse files Browse the repository at this point in the history
  • Loading branch information
trunghai95 committed Nov 1, 2023
1 parent 7c9b79b commit a05af5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/interceptors.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func NewRequestLogInterceptor() grpc.UnaryServerInterceptor {
// Actual process of the request
resp, err := handler(ctx, req)

duration := time.Now().Sub(startTime)
duration := time.Since(startTime)
reqJson, _ := protojson.Marshal(req.(proto.Message))
respJson, _ := protojson.Marshal(resp.(proto.Message))
log.Infof("method[%v] req[%v] resp[%v] err[%v] processTime[%v]", methodName, string(reqJson), string(respJson), err, duration.String())
Expand Down

0 comments on commit a05af5f

Please sign in to comment.