Monday, June 4, 2012

Eclipse Slf4j Logger Template

If you use eclipse and want to save some typing, here is a template for Eclipse to generate an Slf4j Logger for the class you are currently working on.

        private static final Logger LOG = LoggerFactory.getLogger(${primary_type_name}.class);

To use it, open preferences > java > editor > templates, create a new template with the name "log" and paste the code above in the Pattern field.

No comments:

Post a Comment