System.Diagnostics.TraceSwitcher
System.Diagnostics.TraceSwitch Class provides a multilevel switch to control tracing and debug output without recompiling your code. The tracing dumps can be quite verbose. For applications that are constantly running you run the risk of overloading the machine and the hard drive. TraceSwitch does not directly control the Trace statements, you have to pass one of its properties into a WriteLineIf or WriteIf method.The TraceSwitch constructor take three values:
- Display Name
- Description
- Default Trace Value
- TraceLevel.Error: Output error-handling messages.
- TraceLevel.Info Output: informational messages, warnings, and error-handling messages.
- TraceLevel.Off: Output no tracing and debugging messages.
- TraceLevel.Verbose: Output all debugging and tracing messages.
- TraceLevel.Warning: Output warnings and error-handling messages.

Related Topics
- C# Interview Questions (part-1)
- C# Interview Questions (part-2)
- C# Interview Questions (part-3)
- Difference between a Debug and Release build
- Difference between normal DLL and .Net DLL
- What is an Interface in C#
- Difference between Abstract Class and Interface
- Difference between a thread and a process
- Delegates in C# with Examples
- Differences between a control and a component
- Differences between Stack and Heap
- What is .Net Reflection
- Globalization and Localization
- What is .Net serialization
- Difference between web service and .net remoting
- Difference between managed and unmanaged code
- Difference between Shallow copy and Deep copy
- Use of System.Environment Class
- What is the difference between private and shared assembly?
- Does the .NET have in-built support for serialization?
- How to properly stop the Thread in C#?
- Why is XmlSerializer so slow?
- How many types of Jit Compilers?