Skip to content

Commit a4dc4fc

Browse files
committed
jsonrpc2: remove elapsed logging
1 parent 9c738d5 commit a4dc4fc

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

jsonrpc2.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@ func (c *Conn) Call(ctx context.Context, method string, params, result interface
257257
c.pendingMu.Unlock()
258258
}()
259259

260-
start := time.Now()
261-
262260
c.Logger.Debug(Send,
263261
zap.String("req.JSONRPC", req.JSONRPC),
264262
zap.String("id", id.String()),
@@ -273,10 +271,8 @@ func (c *Conn) Call(ctx context.Context, method string, params, result interface
273271
// wait for the response
274272
select {
275273
case resp := <-rchan:
276-
elapsed := time.Since(start)
277274
c.Logger.Debug(Receive,
278275
zap.Stringer("resp.ID", resp.ID),
279-
zap.Duration("elapsed", elapsed),
280276
zap.String("req.Method", req.Method),
281277
zap.Any("resp.Result", resp.Result),
282278
zap.Any("resp.Error", resp.Error),
@@ -345,8 +341,6 @@ func (r *Request) Reply(ctx context.Context, result interface{}, err error) erro
345341
r.Parallel()
346342
r.state = requestReplied
347343

348-
elapsed := time.Since(r.start)
349-
350344
var raw *json.RawMessage
351345
if err == nil {
352346
raw, err = marshalInterface(result)
@@ -368,13 +362,6 @@ func (r *Request) Reply(ctx context.Context, result interface{}, err error) erro
368362

369363
data, err := json.Marshal(resp) // TODO(zchee): use gojay
370364
if err != nil {
371-
r.conn.Logger.Error(Send,
372-
zap.String("resp.ID", resp.ID.String()),
373-
zap.Duration("elapsed", elapsed),
374-
zap.String("r.Method", r.Method),
375-
zap.Any("resp.Result", resp.Result),
376-
zap.Error(err),
377-
)
378365
return Errorf(ParseError, "failed to marshaling reply response: %v", err)
379366
}
380367

0 commit comments

Comments
 (0)