Two thread - two streams for Console.out
<p>all</p>

<p>I've a library, not my, so that then it can't be modified.
This library has two methods, let's call them Method_1() and Method_2().
In these methods is called Console.WriteLine("...")</p>

<p>I've a class</p>

<pre><code>public class CustomBackgroundWorker: BackgroundWorker
{
         private readonly StringBuilder logBuilder;

         public CustomBackgroundWorker ()
         {
             logBuilder = new StringBuilder ();
             TextWriter outStream = new StringWriter (logBuilder);
             Console.SetOut (outStream);
         }

         public string GetLogs ()
         {
             return logBuilder.ToString ();
         }
}
</code></pre>

<p>It creates two instance of this class. Each instance execute method from the library. But output save only in one stream, because SetOut() method work globally.
Is it possible to redirect output from different thread to separate streams?</p>

<p>Thx</p>
