Live Template to log all variables in selection

310 Views Asked by At

I have a good collection of live templates that help me work efficiently, but I have yet to discover a live template which logs all variables and their values. Is there a way it can be done? I'm not familiar with groovy script…

Example:

int i1 = 1, i2 = 2; Selecting the above and using the surround live template would add at $END$:

Log.d(TAG, "Variable values: i1 = [" + i1 + "] i2 = [" + i2 + "]"); or if using Timber

Timber.d("Variable values: i1 = [%s], i2 = [%s]", i1, i2); This would also help the community a lot.

0

There are 0 best solutions below