Details
-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
2.0.0-alpha1
-
None
-
Manual definition of Logger field in class.
Description
Most common use case of logger declaration looks like
import org.slf4j.Logger; import org.slf4j.LoggerFactory; ... private static final Logger logger = LoggerFactory.getLogger(CurrentType.class);
It's almost fine, but it could be more compact:
import org.slf4j.Logger; ... private static final Logger logger = Logger.getLogger(CurrentType.class);
Before java 8 it was not possible (Logger is an interface, not abstract class), now since the minimum required version is 9, the static initialization method can be introduced in the interface.