During debug mode or while I am doing testing, I need to print lots of various information, so i use this method:
#ifdef TESTING
// code with lots of debugging info
#else
// clean code only
#endif // TESTING`
Is this a good method, or is there any other simple and elegant method ?
But this way, I am repeating the same code in two places and if anything is to be changed later on in the code, I have to do it in both places, which is time consuming and error prone.
Thanks.
I am using MS Visual Studio.