Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
Reduce Log Noise (#261)
Browse files Browse the repository at this point in the history
Some more logging level downgrades.
* At steady state we should get only one info level log per new block
* We don't need to know about peer stuff at info
* Caught up to best peer fires for every block
  • Loading branch information
shemnon authored Nov 14, 2018
1 parent 22177b1 commit 22ed035
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private CompletableFuture<SyncTarget> findSyncTarget() {
if (peerTd.compareTo(syncState.chainHeadTotalDifficulty()) <= 0
&& peerHeight <= syncState.chainHeadNumber()) {
// We're caught up to our best peer, try again when a new peer connects
LOG.info("Caught up to best peer: " + bestPeer.chainState().getEstimatedHeight());
LOG.debug("Caught up to best peer: " + bestPeer.chainState().getEstimatedHeight());
return waitForPeerAndThenSetSyncTarget();
}
return DetermineCommonAncestorTask.create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static GetBlockFromPeerTask create(

@Override
protected void executeTaskWithPeer(final EthPeer peer) throws PeerNotConnected {
LOG.info("Downloading block {} from peer {}.", hash, peer);
LOG.debug("Downloading block {} from peer {}.", hash, peer);
downloadHeader(peer)
.thenCompose(this::completeBlock)
.whenComplete(
Expand All @@ -61,7 +61,7 @@ protected void executeTaskWithPeer(final EthPeer peer) throws PeerNotConnected {
LOG.info("Failed to download block {} from peer {}.", hash, peer);
result.get().completeExceptionally(new IncompleteResultsException());
} else {
LOG.info("Successfully downloaded block {} from peer {}.", hash, peer);
LOG.debug("Successfully downloaded block {} from peer {}.", hash, peer);
result.get().complete(new PeerTaskResult<>(r.getPeer(), r.getResult().get(0)));
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ public static WaitForPeerTask create(final EthContext ethContext) {
@Override
protected void executeTask() {
final EthPeers ethPeers = ethContext.getEthPeers();
LOG.info(
LOG.debug(
"Waiting for new peer connection. {} peers currently connected, {} idle.",
ethPeers.peerCount(),
ethPeers.idlePeer().isPresent() ? "Some peers" : "No peers");
// Listen for peer connections and complete task when we hit our target
peerListenerId =
ethPeers.subscribeConnect(
(peer) -> {
LOG.info("Finished waiting for peer connection.");
LOG.debug("Finished waiting for peer connection.");
// We hit our target
result.get().complete(null);
});
Expand Down

0 comments on commit 22ed035

Please sign in to comment.