mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-29 03:41:45 +00:00
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.
|
||||
if cfg.InitialGASSupply <= 0 {
|
||||
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 {
|
||||
cfg.MemPoolSize = defaultMemPoolSize
|
||||
|
|
|
@ -1292,7 +1292,7 @@ func getRequestBlocksPayload(p Peer, currHeight uint32, lastRequestedHeight *ato
|
|||
func (s *Server) handleMessage(peer Peer, msg *Message) error {
|
||||
s.log.Debug("got msg",
|
||||
zap.Stringer("addr", peer.RemoteAddr()),
|
||||
zap.String("type", msg.Command.String()))
|
||||
zap.Stringer("type", msg.Command))
|
||||
|
||||
start := time.Now()
|
||||
defer func() { addCmdTimeMetric(msg.Command, time.Since(start)) }()
|
||||
|
|
|
@ -83,7 +83,7 @@ func (t *TCPTransport) Accept() {
|
|||
if errors.Is(err, net.ErrClosed) && quit {
|
||||
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
|
||||
}
|
||||
p := NewTCPPeer(conn, "", t.server)
|
||||
|
|
|
@ -2640,14 +2640,14 @@ chloop:
|
|||
if err != nil {
|
||||
s.log.Error("failed to marshal notification",
|
||||
zap.Error(err),
|
||||
zap.String("type", resp.Event.String()))
|
||||
zap.Stringer("type", resp.Event))
|
||||
break subloop
|
||||
}
|
||||
msg, err = websocket.NewPreparedMessage(websocket.TextMessage, b)
|
||||
if err != nil {
|
||||
s.log.Error("failed to prepare notification message",
|
||||
zap.Error(err),
|
||||
zap.String("type", resp.Event.String()))
|
||||
zap.Stringer("type", resp.Event))
|
||||
break subloop
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue