简体   繁体   中英

Java: Print every method called to console?

I need to understand a quite large Java project. I browse through it with eclipse and use the call hierarchy and all, but that doesnt get me quite the idea on what is happening when the project runs (it's a webservice).

Is there a possibility to print out every method call with parameters to console? Basically something that puts

System.out.println("methodName, params: " + param1.toString());

in every method for me. Some kind of framework that provides that for example?

You should try to use Aspect-oriented programming (AOP).

Here is an example that does more or less what you want: How to use AOP with AspectJ for logging?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM