@@ -97,7 +97,6 @@ func (c *Conn) AddHandler(handler Handler) {
97
97
// directly wired in. This method allows a higher level protocol to choose how
98
98
// to propagate the cancel.
99
99
func (c * Conn ) Cancel (id ID ) {
100
- c .logger .Debug ("Cancel" )
101
100
c .handlingMu .Lock ()
102
101
handling , found := c .handling [id ]
103
102
c .handlingMu .Unlock ()
@@ -109,8 +108,6 @@ func (c *Conn) Cancel(id ID) {
109
108
110
109
// Notify is called to send a notification request over the connection.
111
110
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
-
114
111
p , err := marshalInterface (params )
115
112
if err != nil {
116
113
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
144
141
145
142
// Call sends a request over the connection and then waits for a response.
146
143
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
-
149
144
// generate a new request identifier
150
145
id := ID {Number : atomic .AddInt64 (& c .seq , 1 )}
151
146
p , err := marshalInterface (params )
@@ -185,14 +180,6 @@ func (c *Conn) Call(ctx context.Context, method string, params, result interface
185
180
}
186
181
}()
187
182
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
196
183
n , err := c .stream .Write (ctx , data )
197
184
for _ , h := range c .handlers {
198
185
ctx = h .Write (ctx , n )
@@ -205,13 +192,6 @@ func (c *Conn) Call(ctx context.Context, method string, params, result interface
205
192
// now wait for the response
206
193
select {
207
194
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
-
215
195
for _ , h := range c .handlers {
216
196
ctx = h .Response (ctx , c , Receive , resp )
217
197
}
@@ -280,9 +260,6 @@ func (c *Conn) Run(ctx context.Context) error {
280
260
for _ , h := range c .handlers {
281
261
h .Error (ctx , errMsg )
282
262
}
283
- c .logger .Debug (Receive .String (),
284
- zap .Error (errMsg ),
285
- )
286
263
continue
287
264
}
288
265
@@ -326,12 +303,6 @@ func (c *Conn) Run(ctx context.Context) error {
326
303
cancelReq ()
327
304
}()
328
305
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
-
335
306
delivered := false
336
307
for _ , h := range c .handlers {
337
308
if h .Deliver (reqCtx , req , delivered ) {
@@ -404,7 +375,6 @@ func (r *Request) Parallel() {
404
375
405
376
// Reply sends a reply to the given request.
406
377
func (r * Request ) Reply (ctx context.Context , result interface {}, reqErr error ) error {
407
- r .conn .logger .Debug ("Reply" )
408
378
if r .state >= reqReplied {
409
379
return fmt .Errorf ("reply invoked more than once" )
410
380
}
@@ -446,12 +416,6 @@ func (r *Request) Reply(ctx context.Context, result interface{}, reqErr error) e
446
416
return err
447
417
}
448
418
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
-
455
419
for _ , h := range r .conn .handlers {
456
420
ctx = h .Response (ctx , r .conn , Send , resp )
457
421
}
0 commit comments