想法实时模板记录方法Args

我希望能够在Jetbrain的Idea中创建一个能够记录方法参数的实时模板。 我们称之为“大”。 它的工作方式如下:

public void get(String one, String two) { larg 

创造

 public void get(String one, String two) { log.info("get: one = " + one + " two = " + two); 

我很好地获取了方法名称,但还没弄明白如何引入方法参数。 有任何想法吗?

我已经晚了4年,但预定义的模板soutp几乎使用groovyscript变量。

这是一个groovy脚本,可以满足您的需求

 groovyScript("'\"' + _1.collect { it + ' = [\" + ' + it + ' + \"]'}.join(', ') + '\"'", methodParameters()) 

这已经晚了6年,但我找到了一个很好的解决方案。 (我的模板中没有任何soutp模板) http://artfulonline.blogspot.com.au/2014/03/quick-logging-with-intellij-live.html

看起来目前无法使用实时模板。

来自Jetbrain的论坛 :

 There is no predefined live template function to do this for you automatically. You can write a plugin that would provide such a function.