Class GuardLogStatementRule

  • All Implemented Interfaces:
    net.sourceforge.pmd.lang.ast.AstVisitor, JavaVisitor, net.sourceforge.pmd.lang.rule.Rule, net.sourceforge.pmd.properties.PropertySource

    public class GuardLogStatementRule
    extends AbstractJavaRulechainRule
    Check that log.debug, log.trace, log.error, etc... statements are guarded by some test expression on log.isDebugEnabled() or log.isTraceEnabled().
    Author:
    Romain Pelisse - <belaran@gmail.com>, Heiko Rupp - <hwr@pilhuhn.de>, Tammo van Lessen - provided original XPath expression
    • Constructor Detail

      • GuardLogStatementRule

        public GuardLogStatementRule()
    • Method Detail

      • start

        public void start​(net.sourceforge.pmd.reporting.RuleContext ctx)
        Specified by:
        start in interface net.sourceforge.pmd.lang.rule.Rule
        Overrides:
        start in class net.sourceforge.pmd.lang.rule.AbstractRule