Only log if logging level is enabled

This commit is contained in:
Norman Maurer 2012-04-19 11:39:50 +02:00
parent 3d762a7594
commit 2cea0dee73

View File

@ -51,7 +51,9 @@ public final class QueueFactory {
//
// This mostly happens because of a custom classloader or security policy that did not allow us to access the
// com.sun.Unmisc class. So just log it and fallback to the old LegacyLinkedTransferQueue that works in all cases
LOGGER.debug("Unable to instance LinkedTransferQueue, fallback to LegacyLinkedTransferQueue", t);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Unable to instance LinkedTransferQueue, fallback to LegacyLinkedTransferQueue", t);
}
}
return new LegacyLinkedTransferQueue<T>();
@ -75,7 +77,9 @@ public final class QueueFactory {
//
// This mostly happens because of a custom classloader or security policy that did not allow us to access the
// com.sun.Unmisc class. So just log it and fallback to the old LegacyLinkedTransferQueue that works in all cases
LOGGER.debug("Unable to instance LinkedTransferQueue, fallback to LegacyLinkedTransferQueue", t);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Unable to instance LinkedTransferQueue, fallback to LegacyLinkedTransferQueue", t);
}
}
return new LegacyLinkedTransferQueue<T>(collection);