Uređivanje

Dijeli putem


TraceFilter Class

Definition

Provides the base class for trace filter implementations.

public ref class TraceFilter abstract
public abstract class TraceFilter
type TraceFilter = class
Public MustInherit Class TraceFilter
Inheritance
TraceFilter
Derived

Remarks

Trace filters can be used by trace listeners to provide an extra layer of filtering beyond that provided by trace switches. The trace filter for a trace listener can be found in the listener's Filter property. Trace switches determine if a trace is to be sent to the trace listeners. Trace filters allow the individual trace listeners to determine whether or not the trace is to be written to the associated output medium. For example, as determined by each trace filter, a trace may be written to the console by a ConsoleTraceListener, but not to the event log by a EventLogTraceListener.

Filters that inherit from the TraceFilter class can be used by trace listeners that inherit from the TraceListener class to perform filtering of events being traced. TraceFilter contains a single method, ShouldTrace, which takes event data and returns a flag indicating whether the event should be traced.

Constructors

TraceFilter()

Initializes a new instance of the TraceFilter class.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ShouldTrace(TraceEventCache, String, TraceEventType, Int32, String, Object[], Object, Object[])

When overridden in a derived class, determines whether the trace listener should trace the event.

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to