Do not use String.format and construct the string only if logger FINEST is enabled.

This commit is contained in:
Matteo Campana 2016-09-27 16:54:05 +02:00
parent 94b3cb2661
commit 350fb833ac

View File

@ -209,8 +209,10 @@ class Connector
if(!running) if(!running)
return; return;
logger.finest(String.format("received datagram packet - addr: %s port: %d", if (logger.isLoggable(Level.FINEST)){
packet.getAddress(), packet.getPort())); logger.finest("received datagram packet - addr: "
+ packet.getAddress() + " port: " + packet.getPort());
}
if (packet.getPort() < 0) if (packet.getPort() < 0)
{ {
logger.warning("Out of range packet port, resetting to 0"); logger.warning("Out of range packet port, resetting to 0");