mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Logging for plugins.
This commit is contained in:
@@ -6,6 +6,8 @@ import java.net.Socket;
|
||||
import java.net.SocketAddress;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.sf.briar.api.ContactId;
|
||||
import net.sf.briar.api.transport.InvalidConfigException;
|
||||
@@ -18,6 +20,9 @@ import net.sf.briar.plugins.AbstractPlugin;
|
||||
abstract class SocketPlugin extends AbstractPlugin
|
||||
implements StreamTransportPlugin {
|
||||
|
||||
private static final Logger LOG =
|
||||
Logger.getLogger(SocketPlugin.class.getName());
|
||||
|
||||
// These fields should be accessed with this's lock held
|
||||
protected StreamTransportCallback callback = null;
|
||||
protected ServerSocket socket = null;
|
||||
@@ -62,7 +67,7 @@ implements StreamTransportPlugin {
|
||||
if(addr == null || ss == null) return;
|
||||
ss.bind(addr);
|
||||
} catch(IOException e) {
|
||||
// FIXME: Logging
|
||||
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.getMessage());
|
||||
return;
|
||||
}
|
||||
synchronized(this) {
|
||||
@@ -70,7 +75,8 @@ implements StreamTransportPlugin {
|
||||
try {
|
||||
ss.close();
|
||||
} catch(IOException e) {
|
||||
// FIXME: Logging
|
||||
if(LOG.isLoggable(Level.WARNING))
|
||||
LOG.warning(e.getMessage());
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -101,7 +107,7 @@ implements StreamTransportPlugin {
|
||||
try {
|
||||
s = ss.accept();
|
||||
} catch(IOException e) {
|
||||
// FIXME: Logging
|
||||
if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.getMessage());
|
||||
return;
|
||||
}
|
||||
synchronized(this) {
|
||||
@@ -109,7 +115,8 @@ implements StreamTransportPlugin {
|
||||
try {
|
||||
s.close();
|
||||
} catch(IOException e) {
|
||||
// FIXME: Logging
|
||||
if(LOG.isLoggable(Level.WARNING))
|
||||
LOG.warning(e.getMessage());
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -138,7 +145,8 @@ implements StreamTransportPlugin {
|
||||
try {
|
||||
socket.close();
|
||||
} catch(IOException e) {
|
||||
// FIXME: Logging
|
||||
if(LOG.isLoggable(Level.WARNING))
|
||||
LOG.warning(e.getMessage());
|
||||
}
|
||||
socket = null;
|
||||
executor.execute(createBinder());
|
||||
|
||||
Reference in New Issue
Block a user