move loglevel to debug (level 4) and remove duplicate log

This commit is contained in:
Rafael Sampaio 2024-10-11 23:51:11 -03:00 committed by Chen Kai
parent e4813a1406
commit bd15e1be1e

View file

@ -555,7 +555,9 @@ func (p *PortalProtocol) processOffer(target *enode.Node, resp []byte, request *
p.Log.Trace("<< ACCEPT/"+p.protocolName, "id", target.ID(), "accept", accept)
isAdded := p.table.addFoundNode(target, true)
if isAdded {
log.Info("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
log.Debug("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
} else {
log.Debug("Node added to replacements list", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
}
var contentKeyLen int
if request.Kind == TransientOfferRequestKind {
@ -677,7 +679,9 @@ func (p *PortalProtocol) processContent(target *enode.Node, resp []byte) (byte,
p.Log.Trace("<< CONTENT/"+p.protocolName, "id", target.ID(), "content", content)
isAdded := p.table.addFoundNode(target, true)
if isAdded {
log.Info("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
log.Debug("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
} else {
log.Debug("Node added to replacements list", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
}
return resp[1], content.Content, nil
case portalwire.ContentConnIdSelector:
@ -690,7 +694,9 @@ func (p *PortalProtocol) processContent(target *enode.Node, resp []byte) (byte,
p.Log.Trace("<< CONTENT_CONNECTION_ID/"+p.protocolName, "id", target.ID(), "resp", common.Bytes2Hex(resp), "connIdMsg", connIdMsg)
isAdded := p.table.addFoundNode(target, true)
if isAdded {
log.Info("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
log.Debug("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
} else {
log.Debug("Node added to replacements list", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
}
connctx, conncancel := context.WithTimeout(p.closeCtx, defaultUTPConnectTimeout)
laddr := p.utp.Addr().(*utp.Addr)
@ -735,7 +741,9 @@ func (p *PortalProtocol) processContent(target *enode.Node, resp []byte) (byte,
p.Log.Trace("<< CONTENT_ENRS/"+p.protocolName, "id", target.ID(), "enrs", enrs)
isAdded := p.table.addFoundNode(target, true)
if isAdded {
log.Info("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
log.Debug("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
} else {
log.Debug("Node added to replacements list", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
}
nodes := p.filterNodes(target, enrs.Enrs, nil)
return resp[1], nodes, nil
@ -761,9 +769,10 @@ func (p *PortalProtocol) processNodes(target *enode.Node, resp []byte, distances
isAdded := p.table.addFoundNode(target, true)
if isAdded {
log.Info("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
log.Debug("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
} else {
log.Debug("Node added to replacements list", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
}
log.Info("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
nodes := p.filterNodes(target, nodesResp.Enrs, distances)
return nodes, nil
@ -822,7 +831,9 @@ func (p *PortalProtocol) processPong(target *enode.Node, resp []byte) (*portalwi
p.Log.Trace("<< PONG_RESPONSE/"+p.protocolName, "id", target.ID(), "pong", pong, "customPayload", customPayload)
isAdded := p.table.addFoundNode(target, true)
if isAdded {
log.Info("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
log.Debug("Node added to bucket", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
} else {
log.Debug("Node added to replacements list", "protocol", p.protocolName, "node", target.IP(), "port", target.UDP())
}
p.radiusCache.Set([]byte(target.ID().String()), customPayload.Radius)
@ -1370,7 +1381,9 @@ func (p *PortalProtocol) lookupWorker(destNode *enode.Node, target enode.ID) ([]
if n.ID() != p.Self().ID() {
isAdded := p.table.addFoundNode(n, false)
if isAdded {
log.Info("Node added to bucket", "protocol", p.protocolName, "node", n.IP(), "port", n.UDP())
log.Debug("Node added to bucket", "protocol", p.protocolName, "node", n.IP(), "port", n.UDP())
} else {
log.Debug("Node added to replacements list", "protocol", p.protocolName, "node", n.IP(), "port", n.UDP())
}
nodes.push(n, portalFindnodesResultLimit)
}