1
0
Fork 0
mirror of https://github.com/sourcegraph/jsonrpc2.git synced 2026-06-16 04:04:56 +02:00

Use correct format string for ID

Audited all calls for Printf. Noticed the following in some logs

```
jsonrpc2 handler: sending response {1 %!d(string=) %!d(bool=false)}: jsonrpc2: connection is closed
```
This commit is contained in:
Keegan Carruthers-Smith 2016-11-14 21:17:22 +02:00
parent bc55a64572
commit 7e53931322
2 changed files with 2 additions and 2 deletions

View file

@ -60,7 +60,7 @@ func LogMessages(log *log.Logger) ConnOpt {
log.Printf("--> result #%s: %s: %s", resp.ID, method, result)
case resp.Error != nil:
err, _ := json.Marshal(resp.Error)
log.Printf("--> error #%d: %s: %s", resp.ID, method, err)
log.Printf("--> error #%s: %s: %s", resp.ID, method, err)
}
}
})(c)

View file

@ -37,7 +37,7 @@ func (h HandlerWithError) Handle(ctx context.Context, conn *Conn, req *Request)
if !req.Notif {
if err := conn.SendResponse(ctx, resp); err != nil {
log.Printf("jsonrpc2 handler: sending response %d: %s", resp.ID, err)
log.Printf("jsonrpc2 handler: sending response %s: %s", resp.ID, err)
}
}
}