Notes to Implementers:

You can minimize the performance penalty of instrumenting your application by using If...Then statements instead of using WriteIf statements. The following two code examples send the same debugging message. However, the first example is much faster when tracing is off, because if mySwitch.TraceError evaluates to false, you do not call Write. The second example always calls WriteIf, even when mySwitch.TraceError is false and no tracing output is produced. This can result in unnecessary execution of arbitrarily complex code.