How to check if LogWriter has been set?
<p>I am trying to handle an Enterprise Library 6 LogWriter Exception that has recently popped up after upgrading from Enterprise Library 4 to 6.</p>

<p>I either get:</p>

<blockquote>
  <p>The LogWriter has not been set for the Logger static class. Set it
  invoking the Logger.SetLogWriter method.</p>
</blockquote>

<p>OR</p>

<blockquote>
  <p>The LogWriter is already set.</p>
</blockquote>

<p>...depending on the scenario.</p>

<p>The problem is that it throws an <code>InvalidOperationException</code> which seems too generic to handle, and that even checking using</p>

<pre><code>if (Logger.Writer == null)
</code></pre>

<p>... also yields an exception, <strong>so how would one then check if the writer is set or not?</strong></p>