From 8b76376bfb964143d3e2b435202691252a6a1479 Mon Sep 17 00:00:00 2001 From: Dan Laine Date: Mon, 11 May 2020 10:42:50 -0400 Subject: [PATCH] lower log levels. Formatting --- networking/handshake_handlers.go | 12 +++++------ snow/networking/router/subnet_router.go | 28 ++++++++++++------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/networking/handshake_handlers.go b/networking/handshake_handlers.go index 32869df..720a83e 100644 --- a/networking/handshake_handlers.go +++ b/networking/handshake_handlers.go @@ -406,7 +406,7 @@ func (nm *Handshake) SendPeerList(peers ...salticidae.PeerID) error { build := Builder{} pl, err := build.PeerList(ipsToSend) if err != nil { - return fmt.Errorf("packing Peerlist failed due to: %w", err) + return fmt.Errorf("packing peer list failed due to: %w", err) } nm.send(pl, peers...) nm.numPeerlistSent.Add(float64(len(peers))) @@ -449,7 +449,7 @@ func connHandler(_conn *C.struct_msgnetwork_conn_t, connected C.bool, _ unsafe.P HandshakeNet.requestedTimeout.Remove(ipID) if _, exists := HandshakeNet.requested[ipStr]; !exists { - HandshakeNet.log.Debug("connHandler called with %s", ip) + HandshakeNet.log.Debug("connHandler called with ip %s", ip) return true } delete(HandshakeNet.requested, ipStr) @@ -568,7 +568,7 @@ func (nm *Handshake) checkCompatibility(peerVersion string) bool { // peers major version is too low return false case major > MajorVersion: - nm.log.Debug("peer attempted to connect with a higher major version, this client may need to be updated") + nm.log.Warn("peer attempted to connect with a higher major version, this client may need to be updated") return false } @@ -577,12 +577,12 @@ func (nm *Handshake) checkCompatibility(peerVersion string) bool { // peers minor version is too low return false case minor > MinorVersion: - nm.log.Debug("peer attempted to connect with a higher minor version, this client may need to be updated") + nm.log.Warn("peer attempted to connect with a higher minor version, this client may need to be updated") return false } if patch > PatchVersion { - nm.log.Debug("peer is connecting with a higher patch version, this client may need to be updated") + nm.log.Warn("peer is connecting with a higher patch version, this client may need to be updated") } return true } @@ -612,7 +612,7 @@ func unknownPeerHandler(_addr *C.netaddr_t, _cert *C.x509_t, _ unsafe.Pointer) { addr := salticidae.NetAddrFromC(salticidae.CNetAddr(_addr)).Copy(true) ip := toIPDesc(addr) - HandshakeNet.log.Debug("adding peer %s", ip) + HandshakeNet.log.Debug("adding peer at %s", ip) var peer salticidae.PeerID var id ids.ShortID diff --git a/snow/networking/router/subnet_router.go b/snow/networking/router/subnet_router.go index 8ca6037..2d9e68a 100644 --- a/snow/networking/router/subnet_router.go +++ b/snow/networking/router/subnet_router.go @@ -64,7 +64,7 @@ func (sr *ChainRouter) RemoveChain(chainID ids.ID) { chain.Shutdown() delete(sr.chains, chainID.Key()) } else { - sr.log.Debug("message referenced a chain, %s, this validator is not validating", chainID) + sr.log.Debug("message referenced a chain, %s, this node doesn't validate", chainID) } } @@ -78,7 +78,7 @@ func (sr *ChainRouter) GetAcceptedFrontier(validatorID ids.ShortID, chainID ids. if chain, exists := sr.chains[chainID.Key()]; exists { chain.GetAcceptedFrontier(validatorID, requestID) } else { - sr.log.Debug("message referenced a chain, %s, this validator is not validating", chainID) + sr.log.Debug("message referenced a chain, %s, this node doesn't validate", chainID) } } @@ -93,7 +93,7 @@ func (sr *ChainRouter) AcceptedFrontier(validatorID ids.ShortID, chainID ids.ID, if chain, exists := sr.chains[chainID.Key()]; exists { chain.AcceptedFrontier(validatorID, requestID, containerIDs) } else { - sr.log.Debug("message referenced a chain, %s, this validator is not validating", chainID) + sr.log.Debug("message referenced a chain, %s, this node doesn't validate", chainID) } } @@ -108,7 +108,7 @@ func (sr *ChainRouter) GetAcceptedFrontierFailed(validatorID ids.ShortID, chainI if chain, exists := sr.chains[chainID.Key()]; exists { chain.GetAcceptedFrontierFailed(validatorID, requestID) } else { - sr.log.Debug("message referenced a chain, %s, this validator is not validating", chainID) + sr.log.Debug("message referenced a chain, %s, this node doesn't validate", chainID) } } @@ -122,7 +122,7 @@ func (sr *ChainRouter) GetAccepted(validatorID ids.ShortID, chainID ids.ID, requ if chain, exists := sr.chains[chainID.Key()]; exists { chain.GetAccepted(validatorID, requestID, containerIDs) } else { - sr.log.Debug("message referenced a chain, %s, this validator is not validating", chainID) + sr.log.Debug("message referenced a chain, %s, this node doesn't validate", chainID) } } @@ -137,7 +137,7 @@ func (sr *ChainRouter) Accepted(validatorID ids.ShortID, chainID ids.ID, request if chain, exists := sr.chains[chainID.Key()]; exists { chain.Accepted(validatorID, requestID, containerIDs) } else { - sr.log.Debug("message referenced a chain, %s, this validator is not validating", chainID) + sr.log.Debug("message referenced a chain, %s, this node doesn't validate", chainID) } } @@ -152,7 +152,7 @@ func (sr *ChainRouter) GetAcceptedFailed(validatorID ids.ShortID, chainID ids.ID if chain, exists := sr.chains[chainID.Key()]; exists { chain.GetAcceptedFailed(validatorID, requestID) } else { - sr.log.Debug("message referenced a chain, %s, this validator is not validating", chainID) + sr.log.Debug("message referenced a chain, %s, this node doesn't validate", chainID) } } @@ -165,7 +165,7 @@ func (sr *ChainRouter) Get(validatorID ids.ShortID, chainID ids.ID, requestID ui if chain, exists := sr.chains[chainID.Key()]; exists { chain.Get(validatorID, requestID, containerID) } else { - sr.log.Debug("message referenced a chain, %s, this validator is not validating", chainID) + sr.log.Debug("message referenced a chain, %s, this node doesn't validate", chainID) } } @@ -181,7 +181,7 @@ func (sr *ChainRouter) Put(validatorID ids.ShortID, chainID ids.ID, requestID ui if chain, exists := sr.chains[chainID.Key()]; exists { chain.Put(validatorID, requestID, containerID, container) } else { - sr.log.Debug("message referenced a chain, %s, this validator is not validating", chainID) + sr.log.Debug("message referenced a chain, %s, this node doesn't validate", chainID) } } @@ -195,7 +195,7 @@ func (sr *ChainRouter) GetFailed(validatorID ids.ShortID, chainID ids.ID, reques if chain, exists := sr.chains[chainID.Key()]; exists { chain.GetFailed(validatorID, requestID, containerID) } else { - sr.log.Debug("message referenced a chain, %s, this validator is not validating", chainID) + sr.log.Debug("message referenced a chain, %s, this node doesn't validate", chainID) } } @@ -208,7 +208,7 @@ func (sr *ChainRouter) PushQuery(validatorID ids.ShortID, chainID ids.ID, reques if chain, exists := sr.chains[chainID.Key()]; exists { chain.PushQuery(validatorID, requestID, containerID, container) } else { - sr.log.Debug("message referenced a chain, %s, this validator is not validating", chainID) + sr.log.Debug("message referenced a chain, %s, this node doesn't validate", chainID) } } @@ -221,7 +221,7 @@ func (sr *ChainRouter) PullQuery(validatorID ids.ShortID, chainID ids.ID, reques if chain, exists := sr.chains[chainID.Key()]; exists { chain.PullQuery(validatorID, requestID, containerID) } else { - sr.log.Debug("message referenced a chain, %s, this validator is not validating", chainID) + sr.log.Debug("message referenced a chain, %s, this node doesn't validate", chainID) } } @@ -236,7 +236,7 @@ func (sr *ChainRouter) Chits(validatorID ids.ShortID, chainID ids.ID, requestID if chain, exists := sr.chains[chainID.Key()]; exists { chain.Chits(validatorID, requestID, votes) } else { - sr.log.Debug("message referenced a chain, %s, this validator is not validating", chainID) + sr.log.Debug("message referenced a chain, %s, this node doesn't validate", chainID) } } @@ -250,7 +250,7 @@ func (sr *ChainRouter) QueryFailed(validatorID ids.ShortID, chainID ids.ID, requ if chain, exists := sr.chains[chainID.Key()]; exists { chain.QueryFailed(validatorID, requestID) } else { - sr.log.Debug("message referenced a chain, %s, this validator is not validating", chainID) + sr.log.Debug("message referenced a chain, %s, this node doesn't validate", chainID) } }