C# does not support C/C++ macros. There are many Q&A related to this in StackOverflow but I couldn't find answer to specific question.
Let say I am using code like one suggested at http://logging.apache.org/log4net/release/faq.html:
if(log.IsDebugEnabled)
{
log.Debug("Entry number: " + i + " is " + entry[i]);
}
This way to enable/disable logging has obvious drawbacks. In C++ I would use a macro like LOG(expr) to improve code readability and to have better control on 'if(log.IsDebugEnabled)' part of code (which is probably repeated thousand times in a project).
How can I achieve LOG(expr) - like result in C#?
Thanks!