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

@@ -1,6 +1,5 @@
package org.briarproject.db;
import static java.util.logging.Level.INFO;
import static java.util.logging.Level.WARNING;
import java.util.TimerTask;
@@ -39,11 +38,11 @@ class DatabaseCleanerImpl extends TimerTask implements DatabaseCleaner {
if(callback == null) throw new IllegalStateException();
try {
if(callback.shouldCheckFreeSpace()) {
if(LOG.isLoggable(INFO)) LOG.info("Checking free space");
LOG.info("Checking free space");
callback.checkFreeSpaceAndClean();
}
} catch(DbClosedException e) {
if(LOG.isLoggable(INFO)) LOG.info("Database closed, exiting");
LOG.info("Database closed, exiting");
} catch(DbException e) {
if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e);
throw new Error(e); // Kill the application

View File

@@ -2,7 +2,6 @@ package org.briarproject.db;
import static java.sql.Types.BINARY;
import static java.sql.Types.VARCHAR;
import static java.util.logging.Level.INFO;
import static java.util.logging.Level.WARNING;
import static org.briarproject.api.Author.Status.ANONYMOUS;
import static org.briarproject.api.Author.Status.UNKNOWN;
@@ -544,8 +543,7 @@ abstract class JdbcDatabase implements Database<Connection> {
try {
connections.wait();
} catch(InterruptedException e) {
if(LOG.isLoggable(INFO))
LOG.info("Interrupted while closing connections");
LOG.warning("Interrupted while closing connections");
interrupted = true;
}
for(Connection c : connections) c.close();