Is there a way to see messages written in Console.Error from a WinForms application?

In my winforms application, I am using a third party library that is included in Console.Error.

Console.Error.WriteLine("some error message");

      

Is there any tool I can use to view these posts? I only want to see them when developing / debugging.

I thought debugview could do this, but it only shows Trace messages. In addition, the Visual Studio Exit window does not display it either (when attached to a process).

If there are no tools, what about a way to redirect StdErr logs to Trace?

+3


source to share


1 answer


You can call Console.SetError

to redirect the output to your own TextWriter

- which in turn can use Trace

or Debug

, or perhaps write to the virtual console in your application.



+4


source







All Articles