Merge pull request #2842 from nspcc-dev/stringer
*: use zap.Stringer instead of zap.String where it can be used
This commit is contained in:
commit
3e714a348e
4 changed files with 5 additions and 5 deletions
|
@ -226,7 +226,7 @@ func NewBlockchain(s storage.Store, cfg config.Blockchain, log *zap.Logger) (*Bl
|
||||||
// Protocol configuration fixups/checks.
|
// Protocol configuration fixups/checks.
|
||||||
if cfg.InitialGASSupply <= 0 {
|
if cfg.InitialGASSupply <= 0 {
|
||||||
cfg.InitialGASSupply = fixedn.Fixed8(defaultInitialGAS)
|
cfg.InitialGASSupply = fixedn.Fixed8(defaultInitialGAS)
|
||||||
log.Info("initial gas supply is not set or wrong, setting default value", zap.String("InitialGASSupply", cfg.InitialGASSupply.String()))
|
log.Info("initial gas supply is not set or wrong, setting default value", zap.Stringer("InitialGASSupply", cfg.InitialGASSupply))
|
||||||
}
|
}
|
||||||
if cfg.MemPoolSize <= 0 {
|
if cfg.MemPoolSize <= 0 {
|
||||||
cfg.MemPoolSize = defaultMemPoolSize
|
cfg.MemPoolSize = defaultMemPoolSize
|
||||||
|
|
|
@ -1292,7 +1292,7 @@ func getRequestBlocksPayload(p Peer, currHeight uint32, lastRequestedHeight *ato
|
||||||
func (s *Server) handleMessage(peer Peer, msg *Message) error {
|
func (s *Server) handleMessage(peer Peer, msg *Message) error {
|
||||||
s.log.Debug("got msg",
|
s.log.Debug("got msg",
|
||||||
zap.Stringer("addr", peer.RemoteAddr()),
|
zap.Stringer("addr", peer.RemoteAddr()),
|
||||||
zap.String("type", msg.Command.String()))
|
zap.Stringer("type", msg.Command))
|
||||||
|
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
defer func() { addCmdTimeMetric(msg.Command, time.Since(start)) }()
|
defer func() { addCmdTimeMetric(msg.Command, time.Since(start)) }()
|
||||||
|
|
|
@ -83,7 +83,7 @@ func (t *TCPTransport) Accept() {
|
||||||
if errors.Is(err, net.ErrClosed) && quit {
|
if errors.Is(err, net.ErrClosed) && quit {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
t.log.Warn("TCP accept error", zap.String("address", l.Addr().String()), zap.Error(err))
|
t.log.Warn("TCP accept error", zap.Stringer("address", l.Addr()), zap.Error(err))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
p := NewTCPPeer(conn, "", t.server)
|
p := NewTCPPeer(conn, "", t.server)
|
||||||
|
|
|
@ -2640,14 +2640,14 @@ chloop:
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.log.Error("failed to marshal notification",
|
s.log.Error("failed to marshal notification",
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
zap.String("type", resp.Event.String()))
|
zap.Stringer("type", resp.Event))
|
||||||
break subloop
|
break subloop
|
||||||
}
|
}
|
||||||
msg, err = websocket.NewPreparedMessage(websocket.TextMessage, b)
|
msg, err = websocket.NewPreparedMessage(websocket.TextMessage, b)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.log.Error("failed to prepare notification message",
|
s.log.Error("failed to prepare notification message",
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
zap.String("type", resp.Event.String()))
|
zap.Stringer("type", resp.Event))
|
||||||
break subloop
|
break subloop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue