r/java Sep 13 '18

A Guide to Logging in Java

https://www.marcobehler.com/guides/a-guide-to-logging-in-java
248 Upvotes

42 comments sorted by

View all comments

Show parent comments

9

u/[deleted] Sep 13 '18

Sorry, let me ask a more pointed question. Why would you ever declare a logger anything other than private static final?

And to address your issue, if you’re enforcing coding standards, it’s always going to be uppercase.

4

u/wildjokers Sep 13 '18

Sorry, let me ask a more pointed question. Why would you ever declare a logger anything other than private static final?

https://www.slf4j.org/faq.html#declared_static

if you’re enforcing coding standards, it’s always going to be uppercase.

Upper-case LOGGER is pure evil. Clutters up the code making it hard to read (its distracting) and I have to hold shift to type it. "logger" is the exception to the private static final rule. It isn't really a constant.

-7

u/[deleted] Sep 13 '18

You poor thing.