Most developers (including me till recently) insert the print statements in their code and the problem with that is that you have to take them out later. I know you can sometimes leave them in the source as tracing statements, but most of the time they have to be taken out. But there is a solution...
The conditional breakpoint editor in Eclipse can be 'tricked' to create what I like to call as Printpoint - and define as a 'point' in code where the debugger does not 'break' but only 'prints' to console. Essentially a Printpoint is a conditional breakpoint that never suspends execution but only prints to console. To set a printpoint, set a conditional breakpoint with Suspend when 'true' option and a condition which is always false. e.g.
Read full article from The Coder Lounge: Printpoints : Debugging by writing to console
No comments:
Post a Comment