TraceListener.TraceData TraceListener.TraceData TraceListener.TraceData TraceListener.TraceData Method

Definition

Writes trace data to the listener specific output.

Overloads

TraceData(TraceEventCache, String, TraceEventType, Int32, Object) TraceData(TraceEventCache, String, TraceEventType, Int32, Object) TraceData(TraceEventCache, String, TraceEventType, Int32, Object) TraceData(TraceEventCache, String, TraceEventType, Int32, Object)

Writes trace information, a data object and event information to the listener specific output.

TraceData(TraceEventCache, String, TraceEventType, Int32, Object[]) TraceData(TraceEventCache, String, TraceEventType, Int32, Object[]) TraceData(TraceEventCache, String, TraceEventType, Int32, Object[]) TraceData(TraceEventCache, String, TraceEventType, Int32, Object[])

Writes trace information, an array of data objects and event information to the listener specific output.

TraceData(TraceEventCache, String, TraceEventType, Int32, Object) TraceData(TraceEventCache, String, TraceEventType, Int32, Object) TraceData(TraceEventCache, String, TraceEventType, Int32, Object) TraceData(TraceEventCache, String, TraceEventType, Int32, Object)

Writes trace information, a data object and event information to the listener specific output.

public:
 virtual void TraceData(System::Diagnostics::TraceEventCache ^ eventCache, System::String ^ source, System::Diagnostics::TraceEventType eventType, int id, System::Object ^ data);
[System.Runtime.InteropServices.ComVisible(false)]
public virtual void TraceData (System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, object data);
abstract member TraceData : System.Diagnostics.TraceEventCache * string * System.Diagnostics.TraceEventType * int * obj -> unit
override this.TraceData : System.Diagnostics.TraceEventCache * string * System.Diagnostics.TraceEventType * int * obj -> unit
Public Overridable Sub TraceData (eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, data As Object)

Parameters

eventCache
TraceEventCache TraceEventCache TraceEventCache TraceEventCache

A TraceEventCache object that contains the current process ID, thread ID, and stack trace information.

source
String String String String

A name used to identify the output, typically the name of the application that generated the trace event.

eventType
TraceEventType TraceEventType TraceEventType TraceEventType

One of the TraceEventType values specifying the type of event that has caused the trace.

id
Int32 Int32 Int32 Int32

A numeric identifier for the event.

data
Object Object Object Object

The trace data to emit.

Remarks

Important

This method is not intended to be called directly by application code but by members of the Debug, Trace, and TraceSource classes to write trace data to output.

The default implementation writes the eventCache, source, eventType and id parameters in the header and footer of the trace. The data parameter is written as the body of the trace message. The ToString method of the data object is used to convert the object to a String.

See also

TraceData(TraceEventCache, String, TraceEventType, Int32, Object[]) TraceData(TraceEventCache, String, TraceEventType, Int32, Object[]) TraceData(TraceEventCache, String, TraceEventType, Int32, Object[]) TraceData(TraceEventCache, String, TraceEventType, Int32, Object[])

Writes trace information, an array of data objects and event information to the listener specific output.

public:
 virtual void TraceData(System::Diagnostics::TraceEventCache ^ eventCache, System::String ^ source, System::Diagnostics::TraceEventType eventType, int id, ... cli::array <System::Object ^> ^ data);
[System.Runtime.InteropServices.ComVisible(false)]
public virtual void TraceData (System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, params object[] data);
abstract member TraceData : System.Diagnostics.TraceEventCache * string * System.Diagnostics.TraceEventType * int * obj[] -> unit
override this.TraceData : System.Diagnostics.TraceEventCache * string * System.Diagnostics.TraceEventType * int * obj[] -> unit
Public Overridable Sub TraceData (eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, ParamArray data As Object())

Parameters

eventCache
TraceEventCache TraceEventCache TraceEventCache TraceEventCache

A TraceEventCache object that contains the current process ID, thread ID, and stack trace information.

source
String String String String

A name used to identify the output, typically the name of the application that generated the trace event.

eventType
TraceEventType TraceEventType TraceEventType TraceEventType

One of the TraceEventType values specifying the type of event that has caused the trace.

id
Int32 Int32 Int32 Int32

A numeric identifier for the event.

data
Object[]

An array of objects to emit as data.

Remarks

Important

This method is not intended to be called directly by application code but by members of the Debug, Trace, and TraceSource classes to write trace data to output.

The default implementation writes the values of the source, eventType and id parameters as a header. The data objects are converted to strings using the ToString method of each object. The eventCache data is written as a footer, the nature of the output data being dependent on the value of the TraceOutputOptions property.

See also

Applies to