Bug 392371 - JavaUtilLog performing expensive format for unlogged items

* Adding isLoggable checks where format() is used
This commit is contained in:
Joakim Erdfelt 2012-12-12 14:38:13 -07:00
parent e30e307367
commit b513244395
1 changed files with 6 additions and 3 deletions

View File

@ -57,6 +57,7 @@ public class JavaUtilLog extends AbstractLogger
public void warn(String msg, Object... args)
{
if (_logger.isLoggable(Level.WARNING))
_logger.log(Level.WARNING,format(msg,args));
}
@ -72,6 +73,7 @@ public class JavaUtilLog extends AbstractLogger
public void info(String msg, Object... args)
{
if (_logger.isLoggable(Level.INFO))
_logger.log(Level.INFO, format(msg, args));
}
@ -105,6 +107,7 @@ public class JavaUtilLog extends AbstractLogger
public void debug(String msg, Object... args)
{
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,format(msg, args));
}