Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: SLF4J_ONLY #66

Open
vorburger opened this issue Jan 30, 2018 · 1 comment
Open

RFE: SLF4J_ONLY #66

vorburger opened this issue Jan 30, 2018 · 1 comment

Comments

@vorburger
Copy link
Contributor

In a large project, it can be useful to enforce that everyone is actually using slf4j and not (directly) log4j (v1/v2) or JUL etc.

A new detector checking that any field / import of a type with simple name Logger must be the org.slf4j.Logger can help with this. This is, of course, "just" a kind of "heuristic", but because in e.g. Log4j and JUL and even other project specific logging frameworks (think e.g. io.vertx.core.logging.Logger and what not), such utilities typically are actually named Logger as well, this works quite well in practice.

FYI https://github.com/opendaylight/yangtools/blob/master/common/checkstyle-logging/src/main/java/org/opendaylight/yangtools/checkstyle/LoggerMustBeSlf4jCheck.java

@vorburger
Copy link
Contributor Author

one can achieve something similar using Checkstyle's IllegalImport like so:

<module name="IllegalImport">
    <property name="illegalPkgs" value="sun, java.util.logging"/>
</module>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant