Skip to content

Commit 9e6a014

Browse files
committed
jsonrpc2: remove debug logging
1 parent dbf9290 commit 9e6a014

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

jsonrpc2.go

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ func (c *Conn) AddHandler(handler Handler) {
9797
// directly wired in. This method allows a higher level protocol to choose how
9898
// to propagate the cancel.
9999
func (c *Conn) Cancel(id ID) {
100-
c.logger.Debug("Cancel")
101100
c.handlingMu.Lock()
102101
handling, found := c.handling[id]
103102
c.handlingMu.Unlock()
@@ -109,8 +108,6 @@ func (c *Conn) Cancel(id ID) {
109108

110109
// Notify is called to send a notification request over the connection.
111110
func (c *Conn) Notify(ctx context.Context, method string, params interface{}) error {
112-
c.logger.Debug("Notify", zap.String("method", method), zap.Any("params", params))
113-
114111
p, err := marshalInterface(params)
115112
if err != nil {
116113
return fmt.Errorf("failed to marshaling notify parameters: %v", err)
@@ -144,8 +141,6 @@ func (c *Conn) Notify(ctx context.Context, method string, params interface{}) er
144141

145142
// Call sends a request over the connection and then waits for a response.
146143
func (c *Conn) Call(ctx context.Context, method string, params, result interface{}) error {
147-
c.logger.Debug("Call", zap.String("method", method), zap.Any("params", params))
148-
149144
// generate a new request identifier
150145
id := ID{Number: atomic.AddInt64(&c.seq, 1)}
151146
p, err := marshalInterface(params)
@@ -185,14 +180,6 @@ func (c *Conn) Call(ctx context.Context, method string, params, result interface
185180
}
186181
}()
187182

188-
c.logger.Debug(Send.String(),
189-
zap.String("req.JSONRPC", req.JSONRPC),
190-
zap.String("id", id.String()),
191-
zap.String("req.method", req.Method),
192-
zap.Any("req.params", req.Params),
193-
)
194-
195-
// now we are ready to send
196183
n, err := c.stream.Write(ctx, data)
197184
for _, h := range c.handlers {
198185
ctx = h.Write(ctx, n)
@@ -205,13 +192,6 @@ func (c *Conn) Call(ctx context.Context, method string, params, result interface
205192
// now wait for the response
206193
select {
207194
case resp := <-rchan:
208-
c.logger.Debug(Receive.String(),
209-
zap.Stringer("resp.ID", resp.ID),
210-
zap.String("req.Method", req.Method),
211-
zap.Any("resp.Result", resp.Result),
212-
zap.Any("resp.Error", resp.Error),
213-
)
214-
215195
for _, h := range c.handlers {
216196
ctx = h.Response(ctx, c, Receive, resp)
217197
}
@@ -280,9 +260,6 @@ func (c *Conn) Run(ctx context.Context) error {
280260
for _, h := range c.handlers {
281261
h.Error(ctx, errMsg)
282262
}
283-
c.logger.Debug(Receive.String(),
284-
zap.Error(errMsg),
285-
)
286263
continue
287264
}
288265

@@ -326,12 +303,6 @@ func (c *Conn) Run(ctx context.Context) error {
326303
cancelReq()
327304
}()
328305

329-
c.logger.Debug(Receive.String(),
330-
zap.Stringer("req.ID", req.ID),
331-
zap.String("req.Method", req.Method),
332-
zap.Any("req.Params", req.Params),
333-
)
334-
335306
delivered := false
336307
for _, h := range c.handlers {
337308
if h.Deliver(reqCtx, req, delivered) {
@@ -404,7 +375,6 @@ func (r *Request) Parallel() {
404375

405376
// Reply sends a reply to the given request.
406377
func (r *Request) Reply(ctx context.Context, result interface{}, reqErr error) error {
407-
r.conn.logger.Debug("Reply")
408378
if r.state >= reqReplied {
409379
return fmt.Errorf("reply invoked more than once")
410380
}
@@ -446,12 +416,6 @@ func (r *Request) Reply(ctx context.Context, result interface{}, reqErr error) e
446416
return err
447417
}
448418

449-
r.conn.logger.Debug(Send.String(),
450-
zap.Stringer("resp.ID", resp.ID),
451-
zap.String("r.Method", r.Method),
452-
zap.Any("resp.Result", resp.Result),
453-
)
454-
455419
for _, h := range r.conn.handlers {
456420
ctx = h.Response(ctx, r.conn, Send, resp)
457421
}

0 commit comments

Comments
 (0)