Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

EventSource::IsEnabled Method (EventLevel, EventKeywords, EventChannel)

.NET Framework (current version)
 

Determines whether the current event source is enabled for events with the specified level, keywords and channel.

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

public:
bool IsEnabled(
	EventLevel level,
	EventKeywords keywords,
	EventChannel channel
)

Parameters

level
Type: System.Diagnostics.Tracing::EventLevel

The event level to check. An event source will be considered enabled when its level is greater than or equal to level.

keywords
Type: System.Diagnostics.Tracing::EventKeywords

The event keywords to check.

channel
Type: System.Diagnostics.Tracing::EventChannel

The event channel to check.

Return Value

Type: System::Boolean

true if the event source is enabled for the specified event level, keywords and channel; otherwise, false.

The result of this method is only an approximation of whether a particular event is active. Use it to avoid expensive computation for logging when logging is disabled. Event sources may have additional filtering that determines their activity..

If the

Universal Windows Platform
Available since 10
.NET Framework
Available since 4.6
Return to top
Show:
© 2017 Microsoft