Removed unnecessary conditionals from logging statements.

Very important stuff.
This commit is contained in:
akwizgran
2014-03-12 21:00:14 +00:00
parent 375a597dd2
commit b99a503f24
33 changed files with 165 additions and 240 deletions

View File

@@ -82,14 +82,14 @@ class PluginManagerImpl implements PluginManager {
public synchronized boolean start() {
// Instantiate and start the simplex plugins
if(LOG.isLoggable(INFO)) LOG.info("Starting simplex plugins");
LOG.info("Starting simplex plugins");
Collection<SimplexPluginFactory> sFactories =
simplexPluginConfig.getFactories();
final CountDownLatch sLatch = new CountDownLatch(sFactories.size());
for(SimplexPluginFactory factory : sFactories)
pluginExecutor.execute(new SimplexPluginStarter(factory, sLatch));
// Instantiate and start the duplex plugins
if(LOG.isLoggable(INFO)) LOG.info("Starting duplex plugins");
LOG.info("Starting duplex plugins");
Collection<DuplexPluginFactory> dFactories =
duplexPluginConfig.getFactories();
final CountDownLatch dLatch = new CountDownLatch(dFactories.size());
@@ -100,13 +100,12 @@ class PluginManagerImpl implements PluginManager {
sLatch.await();
dLatch.await();
} catch(InterruptedException e) {
if(LOG.isLoggable(WARNING))
LOG.warning("Interrupted while starting plugins");
LOG.warning("Interrupted while starting plugins");
Thread.currentThread().interrupt();
return false;
}
// Start the poller
if(LOG.isLoggable(INFO)) LOG.info("Starting poller");
LOG.info("Starting poller");
List<Plugin> start = new ArrayList<Plugin>(plugins.values());
poller.start(Collections.unmodifiableList(start));
return true;
@@ -114,15 +113,15 @@ class PluginManagerImpl implements PluginManager {
public synchronized boolean stop() {
// Stop the poller
if(LOG.isLoggable(INFO)) LOG.info("Stopping poller");
LOG.info("Stopping poller");
poller.stop();
final CountDownLatch latch = new CountDownLatch(plugins.size());
// Stop the simplex plugins
if(LOG.isLoggable(INFO)) LOG.info("Stopping simplex plugins");
LOG.info("Stopping simplex plugins");
for(SimplexPlugin plugin : simplexPlugins)
pluginExecutor.execute(new PluginStopper(plugin, latch));
// Stop the duplex plugins
if(LOG.isLoggable(INFO)) LOG.info("Stopping duplex plugins");
LOG.info("Stopping duplex plugins");
for(DuplexPlugin plugin : duplexPlugins)
pluginExecutor.execute(new PluginStopper(plugin, latch));
plugins.clear();
@@ -132,8 +131,7 @@ class PluginManagerImpl implements PluginManager {
try {
latch.await();
} catch(InterruptedException e) {
if(LOG.isLoggable(WARNING))
LOG.warning("Interrupted while stopping plugins");
LOG.warning("Interrupted while stopping plugins");
Thread.currentThread().interrupt();
return false;
}

View File

@@ -59,7 +59,7 @@ class PollerImpl implements Poller, Runnable {
while(true) {
synchronized(this) {
if(pollTimes.isEmpty()) {
if(LOG.isLoggable(INFO)) LOG.info("Finished polling");
LOG.info("Finished polling");
return;
}
long now = clock.currentTimeMillis();
@@ -83,8 +83,7 @@ class PollerImpl implements Poller, Runnable {
try {
wait(p.time - now);
} catch(InterruptedException e) {
if(LOG.isLoggable(INFO))
LOG.info("Interrupted while waiting to poll");
LOG.warning("Interrupted while waiting to poll");
Thread.currentThread().interrupt();
return;
}

View File

@@ -87,7 +87,7 @@ abstract class TcpPlugin implements DuplexPlugin {
}
}
if(!found) {
if(LOG.isLoggable(INFO)) LOG.info("Could not bind server socket");
LOG.info("Could not bind server socket");
return;
}
if(!running) {