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:
parent
bc55a64572
commit
7e53931322
2 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue