|
|
|
|
|
by magicalhippo
1905 days ago
|
|
Depending on how complex your debugger is, it allows you to output values that might not be inspectable through the debugger. Especially computed values. Debug printing also allows you to debug programs running in environments where you can't attach a debugger. For example, maybe halting the program causes the bug not to trigger. Or it's a remote system where you cannot attach a debugger for various reasons. Or the bug only happens in the optimized build, which in say C/C++ can make it quite tedious to walk through with a debugger. Most of the time though I use print as "proactive debugging". Having detailed logs available is gold when customer calls with a blocking issue. |
|
Showing function return values automatically was really an eye-opener when I first encountered it.