Name

DefaultTraceListener

Synopsis

This class provides the default TraceListener. By default, an instance of this class is available in the Listeners collection of the Debug and Trace classes. The Write() and WriteLine() methods output to the log and to the active debugger (if any) via the Win32 API function OutputDebugString. The log file is initially unset, so output goes only to the debugger. To specify a log file, set LogFileName. You may also set a logfile in the <assert> element of the application configuration file’s <system.diagnostics> section, as in <assert logfilename="logfile.log"/>.

AssertUiEnabled determines whether to use the user interface for failed assertions. If true, .NET uses a dialog box with the options Abort, Retry, or Fail. Whether this property is set to true or false, .NET always writes messages to the LogFileName, if one is specified. The AssertUiEnabled property can be set using the <assert> element, as in <assert assertuienabled="false"/> (the default is true).

Public Class DefaultTraceListener : Inherits TraceListener
' Public Constructors
   Public Sub New() 
' Public Instance Properties
   Public Property AssertUiEnabled As Boolean  
   Public Property LogFileName As String  
' Public Instance Methods
   Overrides Public Sub Fail( ByVal message As String) 
   Overrides Public Sub Fail(ByVal message As String, 
        ByVal detailMessage As String) 
   Overrides Public Sub Write( ByVal message As String) 
   Overrides Public Sub WriteLine( ByVal message As String) 
End Class

Hierarchy ...

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.