private static final Logger LOG = LoggerFactory.getLogger(MyClass.class);
To make this easier, I can create a template, by going to Window->Preferences, Java->Editor->Templates->New...I fill in a shortcut, for example log, choose "Java Type Members" in the context select box, a short description and then in the "pattern" textarea I write:
private static final Logger LOG = LoggerFactory.getLogger(${enclosing_type}.class);
Now when I write log followed by Ctrl+Enter, I get the whole thing written for me.
No comments:
Post a Comment