XmlWriterTraceListener.TraceEvent Método

Definição

Grava informações de rastreamento de evento no arquivo ou no fluxo de saída.Writes event trace information to the output file or stream.

Sobrecargas

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

Grava informações de rastreamento, uma mensagem e informações de evento no fluxo ou no arquivo.Writes trace information, a message, and event information to the file or stream.

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

Grava informações de rastreamento, uma mensagem formatada e informações de evento no fluxo ou no arquivo.Writes trace information, a formatted message, and event information to the file or stream.

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

Grava informações de rastreamento, uma mensagem e informações de evento no fluxo ou no arquivo.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)

Parâmetros

eventCache
TraceEventCache

Um TraceEventCache que contém as informações atuais de ID de processo, ID de thread e rastreamento de pilha.A TraceEventCache that contains the current process ID, thread ID, and stack trace information.

source
String

O nome da origem.The source name.

eventType
TraceEventType

Um dos valores de TraceEventType.One of the TraceEventType values.

id
Int32

Um identificador numérico do evento.A numeric identifier for the event.

message
String

A mensagem a ser gravada.The message to write.

Comentários

Os eventCache source parâmetros,, e eventType id são usados no cabeçalho e no rodapé do rastreamento.The eventCache, source, eventType, and id parameters are used in the header and footer of the trace. O id parâmetro é convertido em um inteiro não assinado antes da gravação; portanto, um id valor negativo é gravado como um inteiro positivo grande.The id parameter is converted to an unsigned integer before writing, so a negative id value is written as a large positive integer. O message parâmetro é gravado como o Message elemento.The message parameter is written as the Message element.

Importante

Este método não se destina a ser chamado diretamente pelo código do aplicativo.This method is not intended to be called directly by application code. Ele é chamado por métodos das Debug classes, Trace e TraceSource para gravar dados de rastreamento.It is called by methods of the Debug, Trace, and TraceSource classes to write trace data.

Aplica-se a

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

Grava informações de rastreamento, uma mensagem formatada e informações de evento no fluxo ou no arquivo.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);
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())

Parâmetros

eventCache
TraceEventCache

Um TraceEventCache que contém as informações atuais de ID de processo, ID de thread e rastreamento de pilha.A TraceEventCache that contains the current process ID, thread ID, and stack trace information.

source
String

O nome da origem.The source name.

eventType
TraceEventType

Um dos valores de TraceEventType.One of the TraceEventType values.

id
Int32

Um identificador numérico do evento.A numeric identifier for the event.

format
String

Uma cadeia de caracteres de formato que contém zero ou mais itens de formato, que correspondem aos objetos na matriz args.A format string that contains zero or more format items that correspond to objects in the args array.

args
Object[]

Uma matriz de objeto que contém zero ou mais objetos a serem formatados.An object array containing zero or more objects to format.

Comentários

Os eventCache source parâmetros,, e eventType id são usados no cabeçalho e no rodapé do rastreamento.The eventCache, source, eventType, and id parameters are used in the header and footer of the trace. O id parâmetro é convertido em um inteiro não assinado antes da gravação; portanto, um id valor negativo é gravado como um inteiro positivo grande.The id parameter is converted to an unsigned integer before writing, so a negative id value is written as a large positive integer. O String.Format(String, Object[]) método é chamado, passando a format cadeia de caracteres e a args matriz como parâmetros, para formatar a args matriz de objetos como o Message elemento.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.

Importante

Este método não se destina a ser chamado diretamente pelo código do aplicativo.This method is not intended to be called directly by application code. Ele é chamado por métodos das Debug classes, Trace e TraceSource para gravar dados de rastreamento.It is called by methods of the Debug, Trace, and TraceSource classes to write trace data.

Aplica-se a