server: don't always Sprintf params for logger

Add Stringer to Params, if we're not printing Debug messages (which usually is
the case), it won't be called at all. Micro-optimization.
This commit is contained in:
Roman Khimov 2020-10-08 16:29:30 +03:00
parent 70e9e329cd
commit c8ba155d47
2 changed files with 7 additions and 1 deletions

View file

@ -291,7 +291,7 @@ func (s *Server) handleRequest(req *request.In, sub *subscriber) response.Abstra
s.log.Debug("processing rpc request",
zap.String("method", req.Method),
zap.String("params", fmt.Sprintf("%v", reqParams)))
zap.Stringer("params", reqParams))
incCounter(req.Method)