Created
March 13, 2013 20:44
-
-
Save yetanotherchris/5155969 to your computer and use it in GitHub Desktop.
UdpTraceListener example usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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