forked from LBRYCommunity/lbry-sdk
logging
This commit is contained in:
parent
c75665d3f0
commit
c7cb6822cc
4 changed files with 5 additions and 6 deletions
|
@ -57,7 +57,7 @@ class BlobServerProtocol(asyncio.Protocol):
|
||||||
incoming_blob = {'blob_hash': blob.blob_hash, 'length': blob.length}
|
incoming_blob = {'blob_hash': blob.blob_hash, 'length': blob.length}
|
||||||
responses.append(BlobDownloadResponse(incoming_blob=incoming_blob))
|
responses.append(BlobDownloadResponse(incoming_blob=incoming_blob))
|
||||||
self.send_response(responses)
|
self.send_response(responses)
|
||||||
log.info("send %s to %s:%i", blob.blob_hash[:8], peer_address, peer_port)
|
log.debug("send %s to %s:%i", blob.blob_hash[:8], peer_address, peer_port)
|
||||||
try:
|
try:
|
||||||
sent = await blob.sendfile(self)
|
sent = await blob.sendfile(self)
|
||||||
except (ConnectionResetError, BrokenPipeError, RuntimeError, OSError):
|
except (ConnectionResetError, BrokenPipeError, RuntimeError, OSError):
|
||||||
|
|
|
@ -79,8 +79,7 @@ class Node:
|
||||||
|
|
||||||
if not self.protocol.external_ip:
|
if not self.protocol.external_ip:
|
||||||
raise Exception("Cannot determine external IP")
|
raise Exception("Cannot determine external IP")
|
||||||
log.info("Store to %i peers", len(peers))
|
log.debug("Store to %i peers", len(peers))
|
||||||
log.info(peers)
|
|
||||||
for peer in peers:
|
for peer in peers:
|
||||||
log.debug("store to %s %s %s", peer.address, peer.udp_port, peer.tcp_port)
|
log.debug("store to %s %s %s", peer.address, peer.udp_port, peer.tcp_port)
|
||||||
stored_to_tup = await asyncio.gather(
|
stored_to_tup = await asyncio.gather(
|
||||||
|
|
|
@ -288,7 +288,7 @@ class IterativeNodeFinder(IterativeFinder):
|
||||||
found = response.found and self.key != self.protocol.node_id
|
found = response.found and self.key != self.protocol.node_id
|
||||||
|
|
||||||
if found:
|
if found:
|
||||||
log.info("found")
|
log.debug("found")
|
||||||
return self.put_result(self.shortlist, finish=True)
|
return self.put_result(self.shortlist, finish=True)
|
||||||
if self.prev_closest_peer and self.closest_peer and not self._is_closer(self.prev_closest_peer):
|
if self.prev_closest_peer and self.closest_peer and not self._is_closer(self.prev_closest_peer):
|
||||||
# log.info("improving, %i %i %i %i %i", len(self.shortlist), len(self.active), len(self.contacted),
|
# log.info("improving, %i %i %i %i %i", len(self.shortlist), len(self.active), len(self.contacted),
|
||||||
|
@ -302,7 +302,7 @@ class IterativeNodeFinder(IterativeFinder):
|
||||||
log.info("limit hit")
|
log.info("limit hit")
|
||||||
self.put_result(self.active, True)
|
self.put_result(self.active, True)
|
||||||
elif self.max_results and len(self.active) - len(self.yielded_peers) >= self.max_results:
|
elif self.max_results and len(self.active) - len(self.yielded_peers) >= self.max_results:
|
||||||
log.info("max results")
|
log.debug("max results")
|
||||||
self.put_result(self.active, True)
|
self.put_result(self.active, True)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -601,7 +601,7 @@ class KademliaProtocol(DatagramProtocol):
|
||||||
res = await self.get_rpc_peer(peer).store(hash_value)
|
res = await self.get_rpc_peer(peer).store(hash_value)
|
||||||
if res != b"OK":
|
if res != b"OK":
|
||||||
raise ValueError(res)
|
raise ValueError(res)
|
||||||
log.info("Stored %s to %s", binascii.hexlify(hash_value).decode()[:8], peer)
|
log.debug("Stored %s to %s", binascii.hexlify(hash_value).decode()[:8], peer)
|
||||||
return peer.node_id, True
|
return peer.node_id, True
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
log.debug("Timeout while storing blob_hash %s at %s", binascii.hexlify(hash_value).decode()[:8], peer)
|
log.debug("Timeout while storing blob_hash %s at %s", binascii.hexlify(hash_value).decode()[:8], peer)
|
||||||
|
|
Loading…
Reference in a new issue