Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 377 Bytes

GuardLogStatementJavaUtil.md

File metadata and controls

14 lines (11 loc) · 377 Bytes

GuardLogStatementJavaUtil

Category: pmd
Rule Key: pmd:GuardLogStatementJavaUtil


Whenever using a log level, one should check if the loglevel is actually enabled, or otherwise skip the associate String creation and manipulation. Example:

// Add this for performance
if (log.isLoggable(Level.FINE)) { ...
  log.fine("This happens");