Skip to content

Instantly share code, notes, and snippets.

@yetanotherchris
Created March 13, 2013 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yetanotherchris/5155969 to your computer and use it in GitHub Desktop.
Save yetanotherchris/5155969 to your computer and use it in GitHub Desktop.
UdpTraceListener example usage
class Program
{
static void Main(string[] args)
{
Trace.Listeners.Add(new UdpTraceListener());
Thread thread1 = new Thread(() => {
Trace.WriteLine("I'm in a new thread 1");
Trace.WriteLine("I'm in a new thread 2");
Trace.WriteLine("I'm in a new thread 3");
});
Thread thread2 = new Thread(() =>
{
Trace.WriteLine("I'm in a new thread also 1");
Trace.WriteLine("I'm in a new thread also 2");
Trace.WriteLine("I'm in a new thread also 3");
});
thread1.Start();
Trace.WriteLine("Hello world");
Trace.WriteLine("Warning Will Robinson", "warning");
thread2.Start();
Trace.WriteLine("Catastrophic failure", "error");
Trace.WriteLine(42, "fatal");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment