mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-27 03:58:06 +00:00
Merge pull request #1471 from nspcc-dev/rpc-server-logging-improvement
server: don't always Sprintf params for logger
This commit is contained in:
commit
6025c13a6d
2 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
||||||
package request
|
package request
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
type (
|
type (
|
||||||
// Params represents the JSON-RPC params.
|
// Params represents the JSON-RPC params.
|
||||||
Params []Param
|
Params []Param
|
||||||
|
@ -23,3 +25,7 @@ func (p Params) ValueWithType(index int, valType paramType) *Param {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p Params) String() string {
|
||||||
|
return fmt.Sprintf("%v", []Param(p))
|
||||||
|
}
|
||||||
|
|
|
@ -291,7 +291,7 @@ func (s *Server) handleRequest(req *request.In, sub *subscriber) response.Abstra
|
||||||
|
|
||||||
s.log.Debug("processing rpc request",
|
s.log.Debug("processing rpc request",
|
||||||
zap.String("method", req.Method),
|
zap.String("method", req.Method),
|
||||||
zap.String("params", fmt.Sprintf("%v", reqParams)))
|
zap.Stringer("params", reqParams))
|
||||||
|
|
||||||
incCounter(req.Method)
|
incCounter(req.Method)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue