Edit

Share via


TextWriterTraceListener.Writer Property

Definition

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

public:
 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.

Examples

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 );
#endif

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

Applies to

See also