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,7 +57,8 @@ public class JavaUtilLog extends AbstractLogger
public void warn(String msg, Object... args)
{
_logger.log(Level.WARNING, format(msg, args));
if (_logger.isLoggable(Level.WARNING))
_logger.log(Level.WARNING,format(msg,args));
}
public void warn(Throwable thrown)
@ -72,7 +73,8 @@ public class JavaUtilLog extends AbstractLogger
public void info(String msg, Object... args)
{
_logger.log(Level.INFO, format(msg, args));
if (_logger.isLoggable(Level.INFO))
_logger.log(Level.INFO, format(msg, args));
}
public void info(Throwable thrown)
@ -105,7 +107,8 @@ public class JavaUtilLog extends AbstractLogger
public void debug(String msg, Object... args)
{
_logger.log(Level.FINE, format(msg, args));
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE,format(msg, args));
}
public void debug(Throwable thrown)