Is there any methods to remove a line of code from a Release build, but leave it in the Debug build without ugly #if statements?
For example, is there some way to achieve the equivalent of the below code without using all these if statements?
#if DEBUG
Log.Log("I am in debug mode");
#endif
If I have a conditional, run-time check in the Log.Log function, then the string “I am in debug mode” will be preserved within my compiled executable, which is exactly what I do not want.
Define another macro in a common, shared header.
Then replace your calls to
Log.LogwithLOG.