TraceSource.TraceInformation 方法

定义

将信息性消息写入 Listeners 集合中的跟踪侦听器中。Writes an informational message to the trace listeners in the Listeners collection.

重载

TraceInformation(String)

使用指定消息,将信息性消息写入 Listeners 集合中的跟踪侦听器中。Writes an informational message to the trace listeners in the Listeners collection using the specified message.

TraceInformation(String, Object[])

使用指定的对象数组和格式化信息,将信息性消息写入 Listeners 集合中的跟踪侦听器中。Writes an informational message to the trace listeners in the Listeners collection using the specified object array and formatting information.

TraceInformation(String)

使用指定消息,将信息性消息写入 Listeners 集合中的跟踪侦听器中。Writes an informational message to the trace listeners in the Listeners collection using the specified message.

public:
 void TraceInformation(System::String ^ message);
[System.Diagnostics.Conditional("TRACE")]
public void TraceInformation (string message);
member this.TraceInformation : string -> unit
Public Sub TraceInformation (message As String)

参数

message
String

要写入的信息性消息。The informative message to write.

属性

异常

终止期间尝试跟踪事件。An attempt was made to trace an event during finalization.

注解

TraceInformation 方法提供一条信息性消息,该消息应由用户读取,而不是由工具读取。The TraceInformation method provides an informational message intended to be read by users and not by tools.

TraceInformation(String) 调用 TraceEvent(TraceEventType, Int32, String) 方法,将 eventType 设置为 TraceEventType.Information 并将信息性消息传递为消息字符串。TraceInformation(String) calls the TraceEvent(TraceEventType, Int32, String) method, setting eventType to TraceEventType.Information and passing the informative message as the message string. TraceEvent(TraceEventType, Int32, String) 方法又调用每个跟踪侦听器的 TraceEvent(TraceEventCache, String, TraceEventType, Int32, String) 方法。The TraceEvent(TraceEventType, Int32, String) method in turn calls the TraceEvent(TraceEventCache, String, TraceEventType, Int32, String) method of each trace listener.

TraceInformation(String, Object[])

使用指定的对象数组和格式化信息,将信息性消息写入 Listeners 集合中的跟踪侦听器中。Writes an informational message to the trace listeners in the Listeners collection using the specified object array and formatting information.

public:
 void TraceInformation(System::String ^ format, ... cli::array <System::Object ^> ^ args);
[System.Diagnostics.Conditional("TRACE")]
public void TraceInformation (string format, params object[] args);
member this.TraceInformation : string * obj[] -> unit
Public Sub TraceInformation (format As String, ParamArray args As Object())

参数

format
String

包含与零个或多个格式项混合的文本的一个复合格式字符串,与 args 数组中的对象相对应。A composite format string that contains text intermixed with zero or more format items, which correspond to objects in the args array.

args
Object[]

包含零个或多个要格式化的对象的数组。An array containing zero or more objects to format.

属性

异常

formatnullformat is null.

format 无效。format is invalid.

- 或 --or- 表示要设置格式的参数的数字小于零,或者大于等于要设置格式的指定对象的数目。The number that indicates an argument to format is less than zero, or greater than or equal to the number of specified objects to format.

终止期间尝试跟踪事件。An attempt was made to trace an event during finalization.

注解

有关 format 参数的详细信息,请参阅复合格式设置For more information about the format parameter, see Composite Formatting.

TraceInformation 方法提供一条信息性消息,该消息应由用户读取,而不是由工具读取。The TraceInformation method provides an informational message intended to be read by users and not by tools.

TraceInformation(String, Object[]) 调用 TraceEvent(TraceEventType, Int32, String, Object[]) 方法,将 eventType 设置为 TraceEventType.Information 并将消息内容作为包含格式信息的对象数组传递。TraceInformation(String, Object[]) calls the TraceEvent(TraceEventType, Int32, String, Object[]) method, setting eventType to TraceEventType.Information and passing the message content as an object array with formatting information. TraceEvent(TraceEventType, Int32, String, Object[]) 方法又调用每个跟踪侦听器的 TraceEvent(TraceEventCache, String, TraceEventType, Int32, String, Object[]) 方法。The TraceEvent(TraceEventType, Int32, String, Object[]) method in turn calls the TraceEvent(TraceEventCache, String, TraceEventType, Int32, String, Object[]) method of each trace listener.

另请参阅

适用于