Cool Eclipse debugging tip

I found this great tip about adding logging to your code while it is running, without having to re-compile/re-deploy, using conditional breakpoints. Just add a breakpoint and insert your bit of logging code:

return false;

Eclipse will execute the code and not pause because the condition returns false. In fact, you can add any code to the conditional, including changinge values, or logging to a file. out = new"/temp/test.txt", true);
return false;

I’ve recently used this to debug a heavily-multi-threaded app that would get messed up if I tried to pause execution to inspect values.

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply