Checkstyle logging rules 08/7108/4
authorMilos Fabian <milfabia@cisco.com>
Fri, 16 May 2014 10:11:22 +0000 (12:11 +0200)
committerMilos Fabian <milfabia@cisco.com>
Mon, 19 May 2014 10:34:59 +0000 (12:34 +0200)
commit041e2c145c4e88efa7f0a533edc2a761c2de239a
treeaf2bb3e7ed93b7a74e11f63ec6e65a2224a8313f
parent933c0aff1f356fd510ed932d196c9ea3282b74f3
Checkstyle logging rules

added rules:
-avoid using printStackTrace
-avoid using System.out|err.print
-logger must be declared as "private static final"
-no more than one logger declared
-avoid using string concatenation in log message
-logger variable name must be "LOG"
-LoggerFactory#getLogger input Class type parameter is equal to wrapping class name.
-logger must be Slf4j
-log message placeholders count equals to parameters count following (excluding exception type param.)

Change-Id: I6da0c22d80de032eb047b4ca8776f2a38c4a4959
Signed-off-by: Milos Fabian <milfabia@cisco.com>
12 files changed:
common/checkstyle-logging/pom.xml [new file with mode: 0644]
common/checkstyle-logging/src/main/java/org/opendaylight/yangtools/checkstyle/CheckLoggingUtil.java [new file with mode: 0644]
common/checkstyle-logging/src/main/java/org/opendaylight/yangtools/checkstyle/LogMessageConcatenationCheck.java [new file with mode: 0644]
common/checkstyle-logging/src/main/java/org/opendaylight/yangtools/checkstyle/LogMessagePlaceholderCountCheck.java [new file with mode: 0644]
common/checkstyle-logging/src/main/java/org/opendaylight/yangtools/checkstyle/LoggerFactoryClassParameterCheck.java [new file with mode: 0644]
common/checkstyle-logging/src/main/java/org/opendaylight/yangtools/checkstyle/LoggerMustBeSlf4jCheck.java [new file with mode: 0644]
common/checkstyle-logging/src/main/java/org/opendaylight/yangtools/checkstyle/LoggerVariableModifiersCheck.java [new file with mode: 0644]
common/checkstyle-logging/src/main/java/org/opendaylight/yangtools/checkstyle/LoggerVariableNameCheck.java [new file with mode: 0644]
common/checkstyle-logging/src/main/resources/checkstyle-logging.xml [new file with mode: 0644]
common/checkstyle-logging/src/test/java/org/opendaylight/yangtools/checkstyle/CheckLoggingTestClass.java [new file with mode: 0644]
common/checkstyle-logging/src/test/java/org/opendaylight/yangtools/checkstyle/CheckstyleTest.java [new file with mode: 0644]
common/pom.xml