Skip to content

Instantly share code, notes, and snippets.

@codethereforam
Last active November 24, 2023 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codethereforam/10c2f0495a526621e222dd6eea511d4e to your computer and use it in GitHub Desktop.
Save codethereforam/10c2f0495a526621e222dd6eea511d4e to your computer and use it in GitHub Desktop.
idea live template记录方法参数日志
  1. groovy脚本
groovyScript("def result=\"${_1}\" + '() '; def result1=''; def params=\"${_2}\".replaceAll('[\\\\[|\\\\]|\\\\s]', '').split(',').toList(); for(i = 0; i < params.size(); i++) {     result1 += ', ' + params[i];     if (i==0) {         result+= params[i] + ': {}, ';      } else {         result+= params[i] + ': {}, ';      } };  return '\"' + result + '\"' + result1;  ", methodName(), methodParameters());}} 
  1. Template Text: log.debug($logText$);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment