Merge pull request #101 from codex-storage/logging

Logging updates
This commit is contained in:
Csaba Kiraly 2024-10-10 11:22:23 +02:00 committed by GitHub
commit 6e180af4aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -276,7 +276,7 @@ proc updateRecord*(
newSpr = spr.get()
seqNo = d.localNode.record.seqNum
info "Updated discovery SPR", uri = newSpr.toURI()
info "Updated discovery SPR", uri = newSpr.toURI(), newSpr = newSpr.data
d.localNode.record = newSpr
d.localNode.record.data.seqNo = seqNo

View File

@ -20,6 +20,9 @@ const
responseTimeout* = 1.seconds ## timeout for the response of a request-response
## call
logScope:
topics = "discv5 transport"
type
Transport* [Client] = ref object
client: Client
@ -209,6 +212,8 @@ proc receive*(t: Transport, a: Address, packet: openArray[byte]) =
if t.client.addNode(node):
trace "Added new node to routing table after handshake", node, tablesize=t.client.nodesDiscovered()
discard t.sendPending(node)
else:
trace "address mismatch, not adding seen flag", node, address = a, nodeAddress = node.address.get()
else:
trace "Packet decoding error", myport = t.bindAddress.port, error = decoded.error, address = a