Skip to content

Commit

Permalink
Only log if logging level is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
normanmaurer committed Apr 19, 2012
1 parent 54559a9 commit e719f23
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions common/src/main/java/io/netty/util/internal/QueueFactory.java
Expand Up @@ -51,7 +51,9 @@ public static <T> BlockingQueue<T> createQueue(Class<T> itemClass) {
//
// 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>();
Expand All @@ -75,7 +77,9 @@ public static <T> BlockingQueue<T> createQueue(Collection<? extends T> collectio
//
// 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);
Expand Down

0 comments on commit e719f23

Please sign in to comment.