Neat, Quick Debug to Console Output

B3y steven 10/26/2008 11:18:00 PM

A very easy wayt to get Debug output for your debugging purposes:

 


  • Add the 'System.Diagnostics' using statement to the class.
  • use the 'Debug.WriteLine("Batman is totally kick butt");' syntax to send debug signals to any listeners
  • Add a Debug listener to your tester app; 

[code:c#]TextWriterTraceListener myWriter = new TextWriterTraceListener(System.Console.Out);
Debug.Listeners.Add(myWriter);
[/code]

Enjoy!

Tags:

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered By BlogEngine Enhanced with Snapshots

About the author

Steven Hildreth Steven Hildreth
Proof that anyone can setup a blog.

E-mail me LinkedIn Profile

Send mail Sign in

Recent posts