From 90f3d33f867af065bb3f268ee5dc290f88fb80b2 Mon Sep 17 00:00:00 2001
From: akwizgran <akwizgran@users.sourceforge.net>
Date: Wed, 6 Apr 2016 09:52:24 +0100
Subject: [PATCH] Log the transport ID when registering connections.

---
 .../briarproject/plugins/ConnectionRegistryImpl.java  | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/briar-core/src/org/briarproject/plugins/ConnectionRegistryImpl.java b/briar-core/src/org/briarproject/plugins/ConnectionRegistryImpl.java
index 86cfab5a18..6f01f02d7a 100644
--- a/briar-core/src/org/briarproject/plugins/ConnectionRegistryImpl.java
+++ b/briar-core/src/org/briarproject/plugins/ConnectionRegistryImpl.java
@@ -41,7 +41,7 @@ class ConnectionRegistryImpl implements ConnectionRegistry {
 	}
 
 	public void registerConnection(ContactId c, TransportId t) {
-		LOG.info("Connection registered");
+		if (LOG.isLoggable(INFO)) LOG.info("Connection registered: " + t);
 		boolean firstConnection = false;
 		lock.lock();
 		try {
@@ -63,7 +63,6 @@ class ConnectionRegistryImpl implements ConnectionRegistry {
 		} finally {
 			lock.unlock();
 		}
-
 		if (firstConnection) {
 			LOG.info("Contact connected");
 			eventBus.broadcast(new ContactConnectedEvent(c));
@@ -71,7 +70,7 @@ class ConnectionRegistryImpl implements ConnectionRegistry {
 	}
 
 	public void unregisterConnection(ContactId c, TransportId t) {
-		LOG.info("Connection unregistered");
+		if (LOG.isLoggable(INFO)) LOG.info("Connection unregistered: " + t);
 		boolean lastConnection = false;
 		lock.lock();
 		try {
@@ -95,15 +94,13 @@ class ConnectionRegistryImpl implements ConnectionRegistry {
 		} finally {
 			lock.unlock();
 		}
-
 		if (lastConnection) {
 			LOG.info("Contact disconnected");
 			eventBus.broadcast(new ContactDisconnectedEvent(c));
 		}
 	}
 
-	public Collection<ContactId> getConnectedContacts(
-			TransportId t) {
+	public Collection<ContactId> getConnectedContacts(TransportId t) {
 		lock.lock();
 		try {
 			Map<ContactId, Integer> m = connections.get(t);
@@ -115,7 +112,6 @@ class ConnectionRegistryImpl implements ConnectionRegistry {
 		} finally {
 			lock.unlock();
 		}
-
 	}
 
 	public boolean isConnected(ContactId c) {
@@ -125,6 +121,5 @@ class ConnectionRegistryImpl implements ConnectionRegistry {
 		} finally {
 			lock.unlock();
 		}
-
 	}
 }
-- 
GitLab