mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 23:06:39 +01:00
Don't build debug strings when debug is not enabled.
This commit is contained in:
parent
0a263b0ac9
commit
e5e49dc5bd
1 changed files with 17 additions and 12 deletions
|
@ -98,6 +98,7 @@ public abstract class NetworkNode implements MessageListener {
|
|||
|
||||
public SettableFuture<Connection> sendMessage(@NotNull NodeAddress peersNodeAddress,
|
||||
NetworkEnvelope networkEnvelope) {
|
||||
if (log.isDebugEnabled())
|
||||
log.debug("sendMessage: peersNodeAddress=" + peersNodeAddress + "\n\tmessage=" + Utilities.toTruncatedString(networkEnvelope));
|
||||
checkNotNull(peersNodeAddress, "peerAddress must not be null");
|
||||
|
||||
|
@ -123,9 +124,11 @@ public abstract class NetworkNode implements MessageListener {
|
|||
try {
|
||||
// can take a while when using tor
|
||||
long startTs = System.currentTimeMillis();
|
||||
if (log.isDebugEnabled())
|
||||
log.debug("Start create socket to peersNodeAddress {}", peersNodeAddress.getFullAddress());
|
||||
Socket socket = createSocket(peersNodeAddress);
|
||||
long duration = System.currentTimeMillis() - startTs;
|
||||
if (log.isDebugEnabled())
|
||||
log.debug("Socket creation to peersNodeAddress {} took {} ms", peersNodeAddress.getFullAddress(),
|
||||
duration);
|
||||
|
||||
|
@ -139,6 +142,7 @@ public abstract class NetworkNode implements MessageListener {
|
|||
existingConnection = getOutboundConnection(peersNodeAddress);
|
||||
|
||||
if (existingConnection != null) {
|
||||
if (log.isDebugEnabled())
|
||||
log.debug("We found in the meantime a connection for peersNodeAddress {}, " +
|
||||
"so we use that for sending the message.\n" +
|
||||
"That can happen if Tor needs long for creating a new outbound connection.\n" +
|
||||
|
@ -184,6 +188,7 @@ public abstract class NetworkNode implements MessageListener {
|
|||
peersNodeAddress,
|
||||
networkProtoResolver);
|
||||
|
||||
if (log.isDebugEnabled())
|
||||
log.debug("\n\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n" +
|
||||
"NetworkNode created new outbound connection:"
|
||||
+ "\nmyNodeAddress=" + getNodeAddress()
|
||||
|
|
Loading…
Add table
Reference in a new issue