title: How to implement an elegant debug mode for my application
body: <p>I have a .NET winforms application and i am trying to avoid the cumbersome of a debug mode.<br>
  As it is the user selects to <em>Enable Debug</em> and by that some operations will take place like writing a log,displaying messages and so on..<br>
  I would like to avoid the repeating of   </p>
  
  <pre><code>If me.DebugMode then  
      Write a log
      Display A Message on the textBox  
      .....
  </code></pre>
  
  <p>There are several / alot of methods that i use and i don't like the idea of polluting the code with the above code<br>
  Any recommendations more than welcome<br>
  P.S because i have some "complaints" about the "wrong" tag here is the same pseudocode in C# with some extra</p>
  
  <pre><code>if(DebugMode.Checked ==true)
  {
  Write A log
  Display A messagge on the textbox
  Dump data as CSV
  Activate Tab for Comparing data Before/After
  }
  </code></pre>