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)

.NET Framework (current version)
 

Determines whether the current event source that has the specified level and keyword is enabled.

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

public:
bool IsEnabled(
	EventLevel level,
	EventKeywords keywords
)

Parameters

level
Type: System.Diagnostics.Tracing::EventLevel

The level of the event source.

keywords
Type: System.Diagnostics.Tracing::EventKeywords

The keyword of the event source.

Return Value

Type: System::Boolean

true if the event source is enabled; 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.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top
Show:
© 2017 Microsoft