Skipping lines of code after a flag is set
<p>I have a fairly large program (C#) that needs its functionality expanded by adding an option to turn off logging. The program takes a directory location as an argument, where it stores the log. I want it to not log anything if args[0] is empty. Right now the program has lines like this nested all over it:</p>

<pre><code>DiagnosticLog.WriteLine("\t\t----Verifying Plugins were installed correctly----");
</code></pre>

<p>My first idea was to just create and do a check for a global flag within that function and run that line if it wasn't set. That way I could avoid using the same if statement around each of these lines all over the code. Is there a more clever way of just "turning off" these lines during run-time?</p>
