SourceFilter.ShouldTrace Method (TraceEventCache, String, TraceEventType, Int32, String, Object[], Object, Object[])

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Determines whether the trace listener should trace the event.

Namespace:   System.Diagnostics
Assembly:  System (in System.dll)

public override bool ShouldTrace(
	TraceEventCache cache,
	string source,
	TraceEventType eventType,
	int id,
	string formatOrMessage,
	object[] args,
	object data1,
	object[] data
)

Parameters

cache
Type: System.Diagnostics.TraceEventCache

An object that represents the information cache for the trace event.

source
Type: System.String

The name of the source.

eventType
Type: System.Diagnostics.TraceEventType

One of the enumeration values that identifies the event type.

id
Type: System.Int32

A trace identifier number.

formatOrMessage
Type: System.String

The format to use for writing an array of arguments or a message to write.

args
Type: System.Object[]

An array of argument objects.

data1
Type: System.Object

A trace data object.

data
Type: System.Object[]

An array of trace data objects.

Return Value

Type: System.Boolean

true if the trace should be produced; otherwise, false.

Exception Condition
ArgumentNullException

source is null.

If the value of the source parameter matches the value of the Source property, the method returns true.

.NET Framework
Available since 2.0
Return to top
Show: