Saturday, April 11, 2015

Should logger be private static or not

Just read - http://wiki.apache.org/commons/Logging/StaticLog

decision is full of trade off but, that article is the best, so I am referencing it in my blog to let me quickly find it, as that question re-appear again and again.

My position:
Logger should never be public or protected and even share-able with or accessible by others classes, eventually will be enforced by Checkstyle - https://github.com/sevntu-checkstyle/sevntu.checkstyle/issues/286

No comments:

Post a Comment