Although the artifact is good, logger's plug-in is relatively difficult to find, online found an alternative is through the live template, quickly insert log print statements.
What we can do at the moment is:
1, declare the logger variable;
2, the method name and variable are printed at the method entrance.
Implementation 1:
Add the template group named logs to the live template and add live template,abbreviation to fill in your favorite abbreviations, I'm logf. Applicable context Select Statement&expression&declaration,template text input
Private Static final Org.slf4j.Logger LOG = Org.slf4j.LoggerFactory.getLogger ($CLASS _name$. Class);
Implementation 2:
Add a live template, abbreviation, I porridge logp. Template text:
Log.debug ("$METHOD _name$:: $PLACE _holders$", $ARGUMENTS $);
Click Edit variable, several variables are defined as follows:
Place_holders = Groovyscript ("_1.collect {it + ' = [{}] '}.join (', ')", Methodparameters ())
ARGUMENTS = Groovyscript ("_1.collect {it}.join (', ')", Methodparameters ())
Method_name = MethodName ()
Applicable context selection (Java-> statment)
It's done.
Original link: http://artfulonline.blogspot.tw/2014/03/quick-logging-with-intellij-live.html
Idea Quick Add Print log statement