Issue
I want to create a template in Eclipse for printing a log starting from the method signature in the following way:
void myMethod(Type1 param1, Type2 param2){
logger.info("myMethod() - [param1: " + param1 + ", param2: " + param2 + "]");
}
I tried to use the ${enclosing_method_arguments}
variable, but I cannot find yet a solution.
Solution
I don't think this is possible using only templates (unless you want to start parsing the generated string).
Take a look at this Eclipse plugin https://github.com/dernasherbrezon/eclipse-log-param. It should be able to produce (something close to) the desired result.
Note: haven't tried it myself.
Answered By - nyname00
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.