Name

TraceListener

Synopsis

This MustInherit class TraceListener is associated with a trace through inclusion in the Trace.Listeners collection. Each TraceListener is responsible for sending trace output somewhere. For example, when you call Trace.WriteLine(), each TraceListener sends the same output to its respective output destination. Use Name to give a name to your TraceListener instances.

Use IndentLevel to control the level of indentation in the output. IndentSize specifies the number of spaces in each level of indent. NeedIndent toggles whether to indent the output at all. Use Write() and WriteLine() to send output to the TraceListener’s destination. WriteIndent() emits whitespace according to the current IndentLevel and IndentSize. It has the side effect of setting NeedIndent to false, so the next time you call one of the Write* methods, it will not emit extra indentation.

You can use the application configuration file to add or remove TraceListeners. Look up System.Diagnostics.TraceListener in the .NET Framework SDK Documentation for details.

Public MustInherit Class TraceListener : Inherits MarshalByRefObject : Implements IDisposable
' Protected Constructors
   Protected Sub New() 
   Protected Sub New( ByVal name As String) 
' Public Instance Properties
   Public Property IndentLevel As Integer  
   Public Property IndentSize As Integer  
   Overridable Public Property Name As String  
' Protected Instance Properties
   Protected Property NeedIndent As Boolean  
' Public Instance Methods Overridable ...

Get VB.NET Core Classes in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.