Initializes a new instance of the TraceSwitch class.
[Visual Basic] Public Sub New( _ ByVal displayName As String, _ ByVal description As String _ ) [C#] public TraceSwitch( string displayName, string description ); [C++] public: TraceSwitch( String* displayName, String* description ); [JScript] public function TraceSwitch( displayName : String, description : String );
When a TraceSwitch is instantiated, the displayName is used to find initial switch settings in the registry or in environmental variables. If the constructor cannot find initial settings, the Level is set to Off. To specify the TraceLevel, call the Level property with one of the TraceLevel enumeration values.
The level also can be set by an external setting file.
TraceSwitch Class | TraceSwitch Members | System.Diagnostics Namespace | TraceSwitch | TraceLevel | Switch | Debug | Trace