Eclipse Breakpoint System.out

I usually set a breakpoint in my Java application when I want to watch the launch.

However, sometimes I just want to know if the method is called or not. So the breakpoint does not help me, and I insert the "systrace" statement System.out.println("method signature");

I thought it would be a nice feature. If I could set a breakpoint and when the breakpoint is reached, just to print the systrace message and continue execution.

Do you know if this is possible?

+4
source share
1 answer

You must make this a conditional breakpoint with the following condition:

System.out.printf(Thread.currentThread().getStackTrace()[1].getMethodName() + "\n") == null

Eclipse. printf, boolean. , .

+9

Source: https://habr.com/ru/post/1548479/


All Articles