jetty.pmd_logging_ruleset.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jetty-build-support Show documentation
Show all versions of jetty-build-support Show documentation
Build Support for Jetty (Contains Enforcer Rules, PMD Rulesets, etc ...)
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <ruleset name="Custom PMD Ruleset" xmlns="http://pmd.sf.net/ruleset/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd" xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"> <description>PMD Logging Rule Set for Jetty</description> <!-- CUSTOM RULES --> <rule name="AvoidAnonymousLogging" since="1.0" message="Use named logging, not anonymous" class="net.sourceforge.pmd.rules.XPathRule"> <description> AvoidAnonymousLogging finds instances of Anonymous logging use. This is bad form and treats logging of the system as a whole, not descrete parts that can be adjusted (attaching different levels and appenders depending on need) </description> <priority>3</priority> <properties> <property name="xpath"> <value> <![CDATA[ //Name[ starts-with(@Image, 'Log.debug') or starts-with(@Image, 'Log.ignore') or starts-with(@Image, 'Log.info') or starts-with(@Image, 'Log.isDebugEnabled') or starts-with(@Image, 'Log.warn') or starts-with(@Image, 'org.eclipse.jetty.util.log.Log.debug') or starts-with(@Image, 'org.eclipse.jetty.util.log.Log.ignore') or starts-with(@Image, 'org.eclipse.jetty.util.log.Log.info') or starts-with(@Image, 'org.eclipse.jetty.util.log.Log.isDebugEnabled') or starts-with(@Image, 'org.eclipse.jetty.util.log.Log.warn') ] ]]> </value> </property> </properties> <example> <![CDATA[ public void doSomething() { Log.debug("Something happened"); // Not good } ]]> </example> </rule> </ruleset>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy