EventTypeFilter.ShouldTrace 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
确定跟踪侦听器是否应跟踪该事件。
public:
override bool ShouldTrace(System::Diagnostics::TraceEventCache ^ cache, System::String ^ source, System::Diagnostics::TraceEventType eventType, int id, System::String ^ formatOrMessage, cli::array <System::Object ^> ^ args, System::Object ^ data1, cli::array <System::Object ^> ^ data);
public override bool ShouldTrace (System.Diagnostics.TraceEventCache? cache, string source, System.Diagnostics.TraceEventType eventType, int id, string? formatOrMessage, object?[]? args, object? data1, object?[]? data);
public override bool ShouldTrace (System.Diagnostics.TraceEventCache cache, string source, System.Diagnostics.TraceEventType eventType, int id, string formatOrMessage, object[] args, object data1, object[] data);
override this.ShouldTrace : System.Diagnostics.TraceEventCache * string * System.Diagnostics.TraceEventType * int * string * obj[] * obj * obj[] -> bool
Public Overrides Function ShouldTrace (cache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, formatOrMessage As String, args As Object(), data1 As Object, data As Object()) As Boolean
参数
- cache
- TraceEventCache
表示跟踪事件的信息缓存的 TraceEventCache。
- source
- String
源的名称。
- eventType
- TraceEventType
TraceEventType 值之一。
- id
- Int32
跟踪标识符编号。
- formatOrMessage
- String
用于编写参数数组的格式,或者要编写的消息。
- args
- Object[]
参数对象的数组。
- data1
- Object
跟踪数据对象。
- data
- Object[]
跟踪数据对象的数组。
返回
如果应产生跟踪,则为 true
;否则为 false
。
注解
如果 参数的值 eventType
大于或等于 属性的值 EventType ,则 方法返回 true
。
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈