Define contant and use it in Conditional attribute
#define LOG
using System;
using System.IO;
using System.Diagnostics;
class Starter {
staticvoid Main() {
LogInfo(new StreamWriter(@"c:\logfile.txt"));
}
[Conditional("LOG")]
privatestaticvoid LogInfo(StreamWriter sr) {
// write information to log file
}
}