java - Auto-generate Android Log TAG in Android Studio/Intellij idea -


in intellij idea when typing psfs , press ctrl+j ide getting me dialog :

enter image description here

and when press enter

enter image description here

i know can customize own output

enter image description here

but can't doc's how can write own live template.

in end want next result :

typing : psfst -> press ctrl+j -> press enter

result :

public static final string tag = <currentclassname>.class.getsimplename();

it helpfull, because have habit log classes.

i find solution

1) create new live template in plain group
2) in template text :

private static final string tag = $class_name$.class.getsimplename(); 

3) define usage scope :

enter image description here

4) choose shortcut :

enter image description here

finally click on edit variables , change expression value classname()

enter image description here

click ok , apply, ok , use.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -