title: Using Haxe macro for conditional compilation, instead of #if #end
body: <p>Suppose we have a Local class with :</p>
  
  <pre><code>class Local {
      static inline public var logLevel:Int = 3;
  }
  </code></pre>
  
  <p>And some functions :</p>
  
  <pre><code>Tool.debug(s:String)   // compiled if logLevel &gt;= 0
  Tool.moreinfo(s:String)// compiled if logLevel &gt;= 1
  Tool.info(s:String)    // compiled if logLevel &gt;= 2
  Tool.trace(s:String)   // compiled if logLevel &gt;= 3
  Tool.warn(s:String)    // compiled if logLevel &gt;= 4
  Tool.err(s:String)     // compiled if logLevel &gt;= 5
  </code></pre>
  
  <p>We can achieve this using -D and some #if in the code.</p>
  
  <p>However that implies modifying the hxml file all the time. Even if it's just for one value, this isn't ideal for me as all my configuration sits in my Local class.</p>
  
  <p>And if we test the value with simple if (), the code gets bigger with all the if and strings, even if it's never used (because the logLevel is meant as a 'constant').</p>
  
  <p>Is it possible to use macros to overcome those two problems?</p>