Breyta

Deila með


XmlWriterTraceListener.TraceEvent Method

Definition

Writes event trace information to the output file or stream.

Overloads

TraceEvent(TraceEventCache, String, TraceEventType, Int32, String)

Writes trace information, a message, and event information to the file or stream.

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

Writes trace information, a formatted message, and event information to the file or stream.

TraceEvent(TraceEventCache, String, TraceEventType, Int32, String)

Source:
XmlWriterTraceListener.cs
Source:
XmlWriterTraceListener.cs
Source:
XmlWriterTraceListener.cs

Writes trace information, a message, and event information to the file or stream.

public:
 override void TraceEvent(System::Diagnostics::TraceEventCache ^ eventCache, System::String ^ source, System::Diagnostics::TraceEventType eventType, int id, System::String ^ message);
public override void TraceEvent (System.Diagnostics.TraceEventCache? eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string? message);
public override void TraceEvent (System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string message);
override this.TraceEvent : System.Diagnostics.TraceEventCache * string * System.Diagnostics.TraceEventType * int * string -> unit
Public Overrides Sub TraceEvent (eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, message As String)

Parameters

eventCache
TraceEventCache

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

source
String

The source name.

eventType
TraceEventType

One of the TraceEventType values.

id
Int32

A numeric identifier for the event.

message
String

The message to write.

Remarks

The eventCache, source, eventType, and id parameters are used in the header and footer of the trace. The id parameter is converted to an unsigned integer before writing, so a negative id value is written as a large positive integer. The message parameter is written as the Message element.

Important

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

Applies to

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

Source:
XmlWriterTraceListener.cs
Source:
XmlWriterTraceListener.cs
Source:
XmlWriterTraceListener.cs

Writes trace information, a formatted message, and event information to the file or stream.

public:
 override void TraceEvent(System::Diagnostics::TraceEventCache ^ eventCache, System::String ^ source, System::Diagnostics::TraceEventType eventType, int id, System::String ^ format, ... cli::array <System::Object ^> ^ args);
public override void TraceEvent (System.Diagnostics.TraceEventCache? eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string format, params object?[]? args);
public override void TraceEvent (System.Diagnostics.TraceEventCache? eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string? format, params object?[]? args);
public override void TraceEvent (System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string format, params object[] args);
override this.TraceEvent : System.Diagnostics.TraceEventCache * string * System.Diagnostics.TraceEventType * int * string * obj[] -> unit
Public Overrides Sub TraceEvent (eventCache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, format As String, ParamArray args As Object())

Parameters

eventCache
TraceEventCache

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

source
String

The source name.

eventType
TraceEventType

One of the TraceEventType values.

id
Int32

A numeric identifier for the event.

format
String

A format string that contains zero or more format items that correspond to objects in the args array.

args
Object[]

An object array containing zero or more objects to format.

Remarks

The eventCache, source, eventType, and id parameters are used in the header and footer of the trace. The id parameter is converted to an unsigned integer before writing, so a negative id value is written as a large positive integer. The String.Format(String, Object[]) method is called, passing in the format string and args array as parameters, to format the args object array as the Message element.

Important

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

Applies to