Debug output

  • Thread starter Thread starter ablyplus
  • Start date Start date
Hi,

Have you use the tracelisteners ? you can use the debug and the trace
associated to the eventlog or any stream (including filestream).

System.Diagnostics;

TextWriterTraceListener Lstr = new TextWriterTraceListener(@"C:\Log.txt");
Debug.Listeners.Add(Lstr);
Debug.AutoFlush = true;

Now if you call
Debug.WriteLine("your text");

it will be dumped on the inmediate window and in your file. You can also
apply this to the Trace object.

Hope this helps
Salva
 
Back
Top