Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Log.traceCall methods #2500

Merged
merged 4 commits into from Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions common/src/main/java/bisq/common/storage/Storage.java
Expand Up @@ -114,7 +114,6 @@ public void setNumMaxBackupFiles(int numMaxBackupFiles) {
// Save delayed and on a background thread
public void queueUpForSave(T persistable) {
if (persistable != null) {
log.trace("save " + fileName);
checkNotNull(storageFile, "storageFile = null. Call setupFileStorage before using read/write.");

fileManager.saveLater(persistable);
Expand All @@ -125,7 +124,6 @@ public void queueUpForSave(T persistable) {

public void queueUpForSave(T persistable, long delayInMilli) {
if (persistable != null) {
log.trace("save " + fileName);
checkNotNull(storageFile, "storageFile = null. Call setupFileStorage before using read/write.");

fileManager.saveLater(persistable, delayInMilli);
Expand Down
Expand Up @@ -82,7 +82,6 @@ public void cancel() {
}

void handleComplete() {
log.trace("Task completed: " + currentTask.getSimpleName());
sharedModel.persist();
next();
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/bisq/core/alert/AlertManager.java
Expand Up @@ -121,7 +121,7 @@ public boolean addAlertMessageIfKeyIsValid(Alert alert, String privKeyString) {
user.setDevelopersAlert(alert);
boolean result = p2PService.addProtectedStorageEntry(alert, true);
if (result) {
log.trace("Add alertMessage to network was successful. AlertMessage = " + alert);
log.trace("Add alertMessage to network was successful. AlertMessage={}", alert);
}

}
Expand All @@ -132,7 +132,7 @@ public boolean removeAlertMessageIfKeyIsValid(String privKeyString) {
Alert alert = user.getDevelopersAlert();
if (isKeyValid(privKeyString) && alert != null) {
if (p2PService.removeData(alert, true))
log.trace("Remove alertMessage from network was successful. AlertMessage = " + alert);
log.trace("Remove alertMessage from network was successful. AlertMessage={}", alert);

user.setDevelopersAlert(null);
return true;
Expand Down
1 change: 0 additions & 1 deletion core/src/main/java/bisq/core/app/BisqSetup.java
Expand Up @@ -464,7 +464,6 @@ private void checkCryptoSetup() {
Thread checkCryptoThread = new Thread(() -> {
try {
Thread.currentThread().setName("checkCryptoThread");
log.trace("Run crypto test");
// just use any simple dummy msg
Ping payload = new Ping(1, 1);
SealedAndSigned sealedAndSigned = EncryptionService.encryptHybridWithSignature(payload,
Expand Down
1 change: 0 additions & 1 deletion core/src/main/java/bisq/core/app/SetupUtils.java
Expand Up @@ -54,7 +54,6 @@ public static void checkCryptoSetup(KeyRing keyRing, EncryptionService encryptio
public void run() {
try {
Thread.currentThread().setName("checkCryptoThread");
log.trace("Run crypto test");
// just use any simple dummy msg
Ping payload = new Ping(1, 1);
SealedAndSigned sealedAndSigned = EncryptionService.encryptHybridWithSignature(payload,
Expand Down
Expand Up @@ -64,7 +64,6 @@ protected boolean isTxOutputSpendable(TransactionOutput output) {
Address address = WalletService.getAddressFromOutput(output);
boolean containsAddress = addresses.contains(address);
if (!containsAddress)
log.trace("addresses not containing address " + addresses + " / " + address);
return containsAddress;
} else {
log.warn("transactionOutput.getScriptPubKey() not isSentToAddress or isPayToScriptHash");
Expand Down
Expand Up @@ -1072,7 +1072,6 @@ public Transaction addTxToWallet(byte[] serializedTransaction) throws Verificati
// We need to recreate the tx otherwise we get a null pointer...
Transaction transaction = new Transaction(params, serializedTransaction);
transaction.getConfidence(Context.get()).setSource(TransactionConfidence.Source.NETWORK);
log.trace("transaction from serializedTransaction: " + transaction.toString());

if (wallet != null)
wallet.receivePending(transaction, null, true);
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/java/bisq/core/btc/wallet/WalletService.java
Expand Up @@ -197,7 +197,6 @@ public void removeBalanceListener(BalanceListener listener) {

public static void checkWalletConsistency(Wallet wallet) throws WalletException {
try {
log.trace("Check if wallet is consistent before commit.");
checkNotNull(wallet);
checkState(wallet.isConsistent());
} catch (Throwable t) {
Expand All @@ -209,7 +208,6 @@ public static void checkWalletConsistency(Wallet wallet) throws WalletException

public static void verifyTransaction(Transaction transaction) throws TransactionVerificationException {
try {
log.trace("Verify transaction " + transaction);
transaction.verify();
} catch (Throwable t) {
t.printStackTrace();
Expand All @@ -226,7 +224,6 @@ public static void checkAllScriptSignaturesForTx(Transaction transaction) throws

public static void checkScriptSig(Transaction transaction, TransactionInput input, int inputIndex) throws TransactionVerificationException {
try {
log.trace("Verifies that this script (interpreted as a scriptSig) correctly spends the given scriptPubKey. Check input at index: " + inputIndex);
checkNotNull(input.getConnectedOutput(), "input.getConnectedOutput() must not be null");
input.getScriptSig().correctlySpends(transaction, inputIndex, input.getConnectedOutput().getScriptPubKey(), Script.ALL_VERIFY_FLAGS);
} catch (Throwable t) {
Expand Down
Expand Up @@ -161,7 +161,6 @@ public void exportToJson() {

Futures.addCallback(future, new FutureCallback<>() {
public void onSuccess(Void ignore) {
log.trace("onSuccess");
}

public void onFailure(@NotNull Throwable throwable) {
Expand Down
Expand Up @@ -145,7 +145,6 @@ public void onMessage(NetworkEnvelope networkEnvelope, Connection connection) {
@Override
public void onComplete() {
getBlocksRequestHandlers.remove(uid);
log.trace("requestDataHandshake completed.\n\tConnection={}", connection);
}

@Override
Expand Down
Expand Up @@ -350,7 +350,7 @@ private void closeHandler(Connection connection) {
NodeAddress nodeAddress = peersNodeAddressOptional.get();
removeFromRequestBlocksHandlerMap(nodeAddress);
} else {
log.trace("closeHandler: nodeAddress not set in connection " + connection);
log.trace("closeHandler: nodeAddress not set in connection {}", connection);
}
}

Expand Down
3 changes: 0 additions & 3 deletions core/src/main/java/bisq/core/offer/OfferBookService.java
Expand Up @@ -134,7 +134,6 @@ public void onRemoved(Offer offer) {
public void addOffer(Offer offer, ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler) {
boolean result = p2PService.addProtectedStorageEntry(offer.getOfferPayload(), true);
if (result) {
log.trace("Add offer to network was successful. OfferPayload ID = " + offer.getId());
resultHandler.handleResult();
} else {
errorMessageHandler.handleErrorMessage("Add offer failed");
Expand All @@ -144,7 +143,6 @@ public void addOffer(Offer offer, ResultHandler resultHandler, ErrorMessageHandl
public void refreshTTL(OfferPayload offerPayload, ResultHandler resultHandler, ErrorMessageHandler errorMessageHandler) {
boolean result = p2PService.refreshTTL(offerPayload, true);
if (result) {
log.trace("Refresh TTL was successful. OfferPayload ID = " + offerPayload.getId());
resultHandler.handleResult();
} else {
errorMessageHandler.handleErrorMessage("Refresh TTL failed.");
Expand All @@ -161,7 +159,6 @@ public void deactivateOffer(OfferPayload offerPayload, @Nullable ResultHandler r

public void removeOffer(OfferPayload offerPayload, @Nullable ResultHandler resultHandler, @Nullable ErrorMessageHandler errorMessageHandler) {
if (p2PService.removeData(offerPayload, true)) {
log.trace("Remove offer from network was successful. OfferPayload ID = " + offerPayload.getId());
if (resultHandler != null)
resultHandler.handleResult();
} else {
Expand Down
Expand Up @@ -71,7 +71,6 @@ public OfferAvailabilityProtocol(OfferAvailabilityModel model, ResultHandler res
Validator.nonEmptyStringOf(offerMessage.offerId);
if (networkEnvelope instanceof OfferAvailabilityResponse
&& model.getOffer().getId().equals(offerMessage.offerId)) {
log.trace("handle OfferAvailabilityResponse = " + networkEnvelope.getClass().getSimpleName() + " from " + peersNodeAddress);
handleOfferAvailabilityResponse((OfferAvailabilityResponse) networkEnvelope, peersNodeAddress);
}
}
Expand Down
Expand Up @@ -67,7 +67,7 @@ public TradeProtocol(Trade trade) {
PublicKey signaturePubKey = decryptedMessageWithPubKey.getSignaturePubKey();
if (tradingPeerPubKeyRing != null && signaturePubKey.equals(tradingPeerPubKeyRing.getSignaturePubKey())) {
NetworkEnvelope networkEnvelope = decryptedMessageWithPubKey.getNetworkEnvelope();
log.trace("handleNewMessage: message = " + networkEnvelope.getClass().getSimpleName() + " from " + peersNodeAddress);
log.trace("handleNewMessage: message = {} from {}", networkEnvelope.getClass().getSimpleName(), peersNodeAddress);
if (networkEnvelope instanceof TradeMessage) {
TradeMessage tradeMessage = (TradeMessage) networkEnvelope;
nonEmptyStringOf(tradeMessage.getTradeId());
Expand Down
Expand Up @@ -94,7 +94,6 @@ protected void run() {
taker.getMultiSigPubKey()
);
String contractAsJson = Utilities.objectToJson(contract);
log.trace("Contract as json:{}", contractAsJson);
String signature = Sig.sign(processModel.getKeyRing().getSignatureKeyPair().getPrivate(), contractAsJson);

trade.setContract(contract);
Expand Down
2 changes: 0 additions & 2 deletions p2p/src/main/java/bisq/network/p2p/network/Connection.java
Expand Up @@ -212,8 +212,6 @@ private void init(@Nullable NodeAddress peersNodeAddress, NetworkProtoResolver n
if (peersNodeAddress != null)
setPeersNodeAddress(peersNodeAddress);

log.trace("New connection created: " + this.toString());

UserThread.execute(() -> connectionListener.onConnection(this));
} catch (Throwable e) {
handleException(e);
Expand Down
6 changes: 3 additions & 3 deletions p2p/src/main/java/bisq/network/p2p/network/NetworkNode.java
Expand Up @@ -219,7 +219,7 @@ private InboundConnection getInboundConnection(@NotNull NodeAddress peersNodeAdd
Optional<InboundConnection> inboundConnectionOptional = lookupInBoundConnection(peersNodeAddress);
if (inboundConnectionOptional.isPresent()) {
InboundConnection connection = inboundConnectionOptional.get();
log.trace("We have found a connection in inBoundConnections. Connection.uid=" + connection.getUid());
log.trace("We have found a connection in inBoundConnections. Connection.uid={}", connection.getUid());
if (connection.isStopped()) {
log.warn("We have a connection which is already stopped in inBoundConnections. Connection.uid=" + connection.getUid());
inBoundConnections.remove(connection);
Expand All @@ -237,7 +237,7 @@ private OutboundConnection getOutboundConnection(@NotNull NodeAddress peersNodeA
Optional<OutboundConnection> outboundConnectionOptional = lookupOutBoundConnection(peersNodeAddress);
if (outboundConnectionOptional.isPresent()) {
OutboundConnection connection = outboundConnectionOptional.get();
log.trace("We have found a connection in outBoundConnections. Connection.uid=" + connection.getUid());
log.trace("We have found a connection in outBoundConnections. Connection.uid={}", connection.getUid());
if (connection.isStopped()) {
log.warn("We have a connection which is already stopped in outBoundConnections. Connection.uid=" + connection.getUid());
outBoundConnections.remove(connection);
Expand Down Expand Up @@ -394,7 +394,7 @@ public void onConnection(Connection connection) {

@Override
public void onDisconnect(CloseConnectionReason closeConnectionReason, Connection connection) {
log.trace("onDisconnect at server socket connectionListener\n\tconnection={}" + connection);
log.trace("onDisconnect at server socket connectionListener\n\tconnection={}", connection);
//noinspection SuspiciousMethodCalls
inBoundConnections.remove(connection);
printInboundConnections();
Expand Down
Expand Up @@ -167,15 +167,12 @@ private void sendToPeer(Connection connection, BroadcastMessage message) {
if (!connection.isStopped()) {
if (connection.noCapabilityRequiredOrCapabilityIsSupported(message)) {
NodeAddress nodeAddress = connection.getPeersNodeAddressOptional().get();
log.trace("Broadcast message to " + nodeAddress + ".");
SettableFuture<Connection> future = networkNode.sendMessage(connection, message);
Futures.addCallback(future, new FutureCallback<Connection>() {
@Override
public void onSuccess(Connection connection) {
numOfCompletedBroadcasts++;
if (!stopped) {
log.trace("Broadcast to " + nodeAddress + " succeeded.");

if (listener != null)
listener.onBroadcasted(message, numOfCompletedBroadcasts);

Expand Down
Expand Up @@ -408,7 +408,6 @@ public void onFault(String errorMessage, @Nullable Connection connection) {
private void restart() {
if (retryTimer == null) {
retryTimer = UserThread.runAfter(() -> {
log.trace("retryTimer called");
stopped = false;

stopRetryTimer();
Expand Down Expand Up @@ -473,7 +472,7 @@ private void closeHandler(Connection connection) {
handlerMap.remove(nodeAddress);
}
} else {
log.trace("closeRequestDataHandler: nodeAddress not set in connection " + connection);
log.trace("closeRequestDataHandler: nodeAddress not set in connection {}", connection);
}
}

Expand Down
Expand Up @@ -107,7 +107,6 @@ private void sendPing(Connection connection) {
@Override
public void onSuccess(Connection connection) {
if (!stopped) {
log.trace("Send " + ping + " to " + connection + " succeeded.");
KeepAliveHandler.this.connection = connection;
connection.addMessageListener(KeepAliveHandler.this);
} else {
Expand Down Expand Up @@ -148,7 +147,6 @@ public void onMessage(NetworkEnvelope networkEnvelope, Connection connection) {
Pong pong = (Pong) networkEnvelope;
if (pong.getRequestNonce() == nonce) {
int roundTripTime = (int) (System.currentTimeMillis() - sendTs);
log.trace("roundTripTime=" + roundTripTime + "\n\tconnection=" + connection);
connection.getStatistic().setRoundTripTime(roundTripTime);
cleanup();
listener.onComplete();
Expand Down
Expand Up @@ -112,7 +112,6 @@ public void onMessage(NetworkEnvelope networkEnvelope, Connection connection) {
Futures.addCallback(future, new FutureCallback<Connection>() {
@Override
public void onSuccess(Connection connection) {
log.trace("Pong sent successfully");
}

@Override
Expand Down
Expand Up @@ -129,7 +129,6 @@ public void onSuccess(Connection connection) {

PeerExchangeHandler.this.connection = connection;
connection.addMessageListener(PeerExchangeHandler.this);
log.trace("Send " + getPeersRequest + " to " + nodeAddress + " succeeded.");
} else {
log.trace("We have stopped that handler already. We ignore that sendGetPeersRequest.onSuccess call.");
}
Expand Down
Expand Up @@ -302,7 +302,7 @@ private void requestWithAvailablePeers() {
list.addAll(filteredSeedNodeAddresses);

log.debug("Number of peers in list for connectToMorePeers: {}", list.size());
log.trace("Filtered connectToMorePeers list: list=" + list);
log.trace("Filtered connectToMorePeers list: list={}", list);
if (!list.isEmpty()) {
// Don't shuffle as we want the seed nodes at the last entries
NodeAddress nextCandidate = list.get(0);
Expand Down Expand Up @@ -400,8 +400,6 @@ private void closeHandler(Connection connection) {
handlerMap.get(nodeAddress).cancel();
handlerMap.remove(nodeAddress);
}
} else {
log.trace("closeHandler: nodeAddress not set in connection " + connection);
}
}

Expand Down