TextWriterTraceListener.Writer Property


Gets or sets the text writer that receives the tracing or debugging output.

 property System::IO::TextWriter ^ Writer { System::IO::TextWriter ^ get(); void set(System::IO::TextWriter ^ value); };
public System.IO.TextWriter? Writer { get; set; }
public System.IO.TextWriter Writer { get; set; }
member this.Writer : System.IO.TextWriter with get, set
Public Property Writer As TextWriter

Property Value

A TextWriter that represents the writer that receives the tracing or debugging output.


The following example creates a TextWriterTraceListener that writes to the console screen. Then the code adds the new trace listener to the Listeners in the trace class.

#if defined(TRACE)
TextWriterTraceListener^ myWriter = gcnew TextWriterTraceListener;
myWriter->Writer = System::Console::Out;
Trace::Listeners->Add( myWriter );

TextWriterTraceListener myWriter = new TextWriterTraceListener();
   myWriter.Writer = System.Console.Out;
Dim myWriter As New TextWriterTraceListener()
myWriter.Writer = System.Console.Out

Applies to

See also