lishunli / projectlombok

Automatically exported from code.google.com/p/projectlombok
0 stars 0 forks source link

@Slf4j and possibly other log annotations should use an uppercase variable. #425

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use at @Slf4j

What is the expected output? What do you see instead?
The variable to use is log rather than LOG or LOGGER. This is generally Java 
convention.

What version of the product are you using? On what operating system?
0.11.4

Please provide any additional information below.
This should apply to other loggers as well.

Original issue reported on code.google.com by deri...@gmail.com on 30 Oct 2012 at 6:13

GoogleCodeExporter commented 9 years ago
According to the guidelines, uppercase field names are meant for constants. Not 
all static final fields are constants though. Constants should be immutable. 
Loggers are not immutable. One of the reasons they are not is the fact that the 
current level can be changed during the lifetime and that that is observable 
from the program. That's the reason why we chose to make is a lowercase field.

Original comment by r.spilker on 30 Oct 2012 at 11:18

GoogleCodeExporter commented 9 years ago
Makes sense, thanks for the feedback.

Original comment by deri...@gmail.com on 31 Oct 2012 at 12:52

GoogleCodeExporter commented 9 years ago
However to note, the reference is final/constant even though the object is not 
immutable. My 2 cents.

Original comment by deri...@gmail.com on 31 Oct 2012 at 12:54