It seems like it would be ideal (in terms of readability) to use say Debug.WriteLine
to write to output rather than a ton of #if DEBUG
statements.
When the program is compiled in release mode, does all the overhead with the Debug.WriteLine
go away as if it did not exist, or is the function still called, but nothing done internally?
If so, is there any way to obtain this functionality on a custom class, i.e., a static call would only be compiled in if we are in Debug mode?