Trace.TraceError 方法

定义

将错误信息写入 Listeners 集合中的跟踪侦听器中。Writes error information to the trace listeners in the Listeners collection.

重载

TraceError(String)

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

TraceError(String, Object[])

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

TraceError(String)

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

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

参数

message
String

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

属性

注解

TraceErrorTraceEvent 方法用于每个跟踪侦听器,并在跟踪事件类型 Error,将信息性消息作为消息字符串传递。TraceError calls the TraceEvent method for each trace listener, with the trace event type Error, passing the informative message as the message string.

另请参阅

TraceError(String, Object[])

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

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

参数

format
String

一个格式字符串,其中包含零个或多个格式项,这些项对应于 args 数组中的对象。A format string that contains zero or more format items, which correspond to objects in the args array.

args
Object[]

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

属性

注解

TraceError 使用跟踪事件类型 Error调用跟踪侦听器中的 TraceEvent 方法,并将消息内容作为包含格式信息的对象数组进行传递。TraceError calls the TraceEvent methods in the trace listeners with the trace event type Error, passing the message content as an object array with formatting information. 有关 formatargs 参数的详细信息,请参阅 Format 方法。See the Format method for more information about the format and args parameters.

另请参阅

适用于