When coding in C++ I often create a debug log macro so that I can place log statements dedicated to debugging in my code which I can leave there. In a non-debug build the macro will just result in no-op so there is no cost. Would it be possible to achieve a similar feature in C# and Unity?
Perhaps something like this in Debug:
partial void DevLog(string message);
partial void DevLog(string message)
I believe that should be optimized out by the compiler in a non-development build.