Skip to content

Commit

Permalink
move loglevel to debug (level 4) and remove duplicate log
Browse files Browse the repository at this point in the history
  • Loading branch information
r4f4ss authored and GrapeBaBa committed Oct 12, 2024
1 parent e4813a1 commit bd15e1b
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions p2p/discover/portal_protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit bd15e1b

Please sign in to comment.