<template name="logdp" value="android.util.Log.d(TAG, $METHOD_NAME_AND_PARAMETERS$);" description="Log.d(TAG, String)" toReformat="true" toShortenFQNames="true">
<variable name="METHOD_NAME_AND_PARAMETERS" expression="groovyScript("def params = _2.collect {it + ' = [\" + ' + it + ' + \"]'}.join(', ');return '\"' + _1 + '() called' + (params.empty ? '' : ' with: ' + params) + '\"'", methodName(), methodParameters())" defaultValue="" alwaysStopAt="true" />
<context>
<option name="JAVA_STATEMENT" value="true" />
</context>
</template>
把这个导入到live templates里面,就可以调用logdp打印带参数的日志。