diff --git a/src/UiPath.Workflow.Runtime/WfEventSource.cs b/src/UiPath.Workflow.Runtime/WfEventSource.cs index 42bd9efc..03fe6a1d 100644 --- a/src/UiPath.Workflow.Runtime/WfEventSource.cs +++ b/src/UiPath.Workflow.Runtime/WfEventSource.cs @@ -12,9 +12,11 @@ public sealed class WfEventSource : EventSource public static WfEventSource Instance => instance; + private static readonly bool IsWfEtwTracingEnabled = Environment.GetEnvironmentVariable("ENABLE_WF_ETW_TRACING")?.ToLower() == "true"; + public bool TransferEmittedIsEnabled() { - return IsEnabled(EventLevel.LogAlways, Keywords.Troubleshooting | Keywords.UserEvents | Keywords.EndToEndMonitoring | Keywords.ServiceModel | Keywords.WFTracking | Keywords.ServiceHost | Keywords.WCFMessageLogging, EventChannel.Analytic); + return IsTracingEnabled(EventLevel.LogAlways, Keywords.Troubleshooting | Keywords.UserEvents | Keywords.EndToEndMonitoring | Keywords.ServiceModel | Keywords.WFTracking | Keywords.ServiceHost | Keywords.WCFMessageLogging, EventChannel.Analytic); } [Event(EventIds.TransferEmitted, Level = EventLevel.LogAlways, Channel = EventChannel.Analytic, @@ -27,7 +29,7 @@ public void TransferEmitted(Guid newId) public bool WorkflowApplicationCompletedIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.WorkflowApplicationCompleted, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.WFApplicationStateChangeCompleted, Task = Tasks.WFApplicationStateChange, @@ -40,7 +42,7 @@ public void WorkflowApplicationCompleted(string data1) public bool WorkflowApplicationTerminatedIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.WorkflowApplicationTerminated, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.WFApplicationStateChangeTerminated, Task = Tasks.WFApplicationStateChange, @@ -53,7 +55,7 @@ public void WorkflowApplicationTerminated(string data1, string SerializedExcepti public bool WorkflowInstanceCanceledIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.WorkflowInstanceCanceled, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.WFApplicationStateChangeInstanceCanceled, Task = Tasks.WFApplicationStateChange, @@ -66,7 +68,7 @@ public void WorkflowInstanceCanceled(string data1) public bool WorkflowInstanceAbortedIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.WorkflowInstanceAborted, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.WFApplicationStateChangeInstanceAborted, Task = Tasks.WFApplicationStateChange, @@ -79,7 +81,7 @@ public void WorkflowInstanceAborted(string data1, string SerializedException) public bool WorkflowApplicationIdledIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.WorkflowApplicationIdled, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.WFApplicationStateChangeIdled, Task = Tasks.WFApplicationStateChange, @@ -92,7 +94,7 @@ public void WorkflowApplicationIdled(string data1) public bool WorkflowApplicationUnhandledExceptionIsEnabled() { - return IsEnabled(EventLevel.Error, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Error, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.WorkflowApplicationUnhandledException, Level = EventLevel.Error, Channel = EventChannel.Debug, Opcode = Opcodes.WFApplicationStateChangeUnhandledException, Task = Tasks.WFApplicationStateChange, @@ -105,7 +107,7 @@ public void WorkflowApplicationUnhandledException(string data1, string data2, st public bool WorkflowApplicationPersistedIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.WorkflowApplicationPersisted, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.WFApplicationStateChangePersisted, Task = Tasks.WFApplicationStateChange, @@ -118,7 +120,7 @@ public void WorkflowApplicationPersisted(string data1) public bool WorkflowApplicationUnloadedIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.WorkflowApplicationUnloaded, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.WFApplicationStateChangeUnloaded, Task = Tasks.WFApplicationStateChange, @@ -131,7 +133,7 @@ public void WorkflowApplicationUnloaded(string data1) public bool ActivityScheduledIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.ActivityScheduled, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = EventOpcode.Info, Task = Tasks.ScheduleActivity, @@ -144,7 +146,7 @@ public void ActivityScheduled(string data1, string data2, string data3, string d public bool ActivityCompletedIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.ActivityCompleted, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = EventOpcode.Info, Task = Tasks.CompleteActivity, @@ -157,7 +159,7 @@ public void ActivityCompleted(string data1, string data2, string data3, string d public bool ScheduleExecuteActivityWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.ScheduleExecuteActivityWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.ScheduleWorkItemScheduleExecuteActivity, Task = Tasks.ScheduleWorkItem, @@ -170,7 +172,7 @@ public void ScheduleExecuteActivityWorkItem(string data1, string data2, string d public bool StartExecuteActivityWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.StartExecuteActivityWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.StartWorkItemStartExecuteActivity, Task = Tasks.StartWorkItem, @@ -183,7 +185,7 @@ public void StartExecuteActivityWorkItem(string data1, string data2, string data public bool CompleteExecuteActivityWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.CompleteExecuteActivityWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.CompleteWorkItemCompleteExecuteActivity, Task = Tasks.CompleteWorkItem, @@ -196,7 +198,7 @@ public void CompleteExecuteActivityWorkItem(string data1, string data2, string d public bool ScheduleCompletionWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.ScheduleCompletionWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.ScheduleWorkItemScheduleCompletion, Task = Tasks.ScheduleWorkItem, @@ -209,7 +211,7 @@ public void ScheduleCompletionWorkItem(string data1, string data2, string data3, public bool StartCompletionWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.StartCompletionWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.StartWorkItemStartCompletion, Task = Tasks.StartWorkItem, @@ -222,7 +224,7 @@ public void StartCompletionWorkItem(string data1, string data2, string data3, st public bool CompleteCompletionWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.CompleteCompletionWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.CompleteWorkItemCompleteCompletion, Task = Tasks.CompleteWorkItem, @@ -235,7 +237,7 @@ public void CompleteCompletionWorkItem(string data1, string data2, string data3, public bool ScheduleCancelActivityWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.ScheduleCancelActivityWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.ScheduleWorkItemScheduleCancelActivity, Task = Tasks.ScheduleWorkItem, @@ -248,7 +250,7 @@ public void ScheduleCancelActivityWorkItem(string data1, string data2, string da public bool StartCancelActivityWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.StartCancelActivityWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.StartWorkItemStartCancelActivity, Task = Tasks.StartWorkItem, @@ -261,7 +263,7 @@ public void StartCancelActivityWorkItem(string data1, string data2, string data3 public bool CompleteCancelActivityWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.CompleteCancelActivityWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.CompleteWorkItemCompleteCancelActivity, Task = Tasks.CompleteWorkItem, @@ -274,7 +276,7 @@ public void CompleteCancelActivityWorkItem(string data1, string data2, string da public bool CreateBookmarkIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.CreateBookmark, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = EventOpcode.Info, Task = Tasks.CreateBookmark, @@ -287,7 +289,7 @@ public void CreateBookmark(string data1, string data2, string data3, string data public bool ScheduleBookmarkWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.ScheduleBookmarkWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.ScheduleWorkItemScheduleBookmark, Task = Tasks.ScheduleWorkItem, @@ -300,7 +302,7 @@ public void ScheduleBookmarkWorkItem(string data1, string data2, string data3, s public bool StartBookmarkWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.StartBookmarkWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.StartWorkItemStartBookmark, Task = Tasks.StartWorkItem, @@ -313,7 +315,7 @@ public void StartBookmarkWorkItem(string data1, string data2, string data3, stri public bool CompleteBookmarkWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.CompleteBookmarkWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.CompleteWorkItemCompleteBookmark, Task = Tasks.CompleteWorkItem, @@ -326,7 +328,7 @@ public void CompleteBookmarkWorkItem(string data1, string data2, string data3, s public bool CreateBookmarkScopeIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.CreateBookmarkScope, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = EventOpcode.Info, Task = Tasks.CreateBookmark, @@ -339,7 +341,7 @@ public void CreateBookmarkScope(string data1) public bool BookmarkScopeInitializedIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.BookmarkScopeInitialized, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = EventOpcode.Info, Task = Tasks.InitializeBookmarkScope, @@ -352,7 +354,7 @@ public void BookmarkScopeInitialized(string data1, string data2) public bool ScheduleTransactionContextWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.ScheduleTransactionContextWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.ScheduleWorkItemScheduleTransactionContext, Task = Tasks.ScheduleWorkItem, @@ -365,7 +367,7 @@ public void ScheduleTransactionContextWorkItem(string data1, string data2, strin public bool StartTransactionContextWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.StartTransactionContextWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.StartWorkItemStartTransactionContext, Task = Tasks.StartWorkItem, @@ -378,7 +380,7 @@ public void StartTransactionContextWorkItem(string data1, string data2, string d public bool CompleteTransactionContextWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.CompleteTransactionContextWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.CompleteWorkItemCompleteTransactionContext, Task = Tasks.CompleteWorkItem, @@ -391,7 +393,7 @@ public void CompleteTransactionContextWorkItem(string data1, string data2, strin public bool ScheduleFaultWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.ScheduleFaultWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.ScheduleWorkItemScheduleFault, Task = Tasks.ScheduleWorkItem, @@ -404,7 +406,7 @@ public void ScheduleFaultWorkItem(string data1, string data2, string data3, stri public bool StartFaultWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.StartFaultWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.StartWorkItemStartFault, Task = Tasks.StartWorkItem, @@ -417,7 +419,7 @@ public void StartFaultWorkItem(string data1, string data2, string data3, string public bool CompleteFaultWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.CompleteFaultWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.CompleteWorkItemCompleteFault, Task = Tasks.CompleteWorkItem, @@ -430,7 +432,7 @@ public void CompleteFaultWorkItem(string data1, string data2, string data3, stri public bool ScheduleRuntimeWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.ScheduleRuntimeWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.ScheduleWorkItemScheduleRuntime, Task = Tasks.ScheduleWorkItem, @@ -443,7 +445,7 @@ public void ScheduleRuntimeWorkItem(string data1, string data2, string data3) public bool StartRuntimeWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.StartRuntimeWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.StartWorkItemStartRuntime, Task = Tasks.StartWorkItem, @@ -456,7 +458,7 @@ public void StartRuntimeWorkItem(string data1, string data2, string data3) public bool CompleteRuntimeWorkItemIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.CompleteRuntimeWorkItem, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.CompleteWorkItemCompleteRuntime, Task = Tasks.CompleteWorkItem, @@ -469,7 +471,7 @@ public void CompleteRuntimeWorkItem(string data1, string data2, string data3) public bool RuntimeTransactionSetIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFServices, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFServices, EventChannel.Debug); } [Event(EventIds.RuntimeTransactionSet, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.RuntimeTransactionSet, Task = Tasks.RuntimeTransaction, @@ -482,7 +484,7 @@ public void RuntimeTransactionSet(string data1, string data2, string data3, stri public bool RuntimeTransactionCompletionRequestedIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFServices, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFServices, EventChannel.Debug); } [Event(EventIds.RuntimeTransactionCompletionRequested, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.RuntimeTransactionCompletionRequested, Task = Tasks.RuntimeTransaction, @@ -495,7 +497,7 @@ public void RuntimeTransactionCompletionRequested(string data1, string data2, st public bool RuntimeTransactionCompleteIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFServices, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFServices, EventChannel.Debug); } [Event(EventIds.RuntimeTransactionComplete, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.RuntimeTransactionComplete, Task = Tasks.RuntimeTransaction, @@ -508,7 +510,7 @@ public void RuntimeTransactionComplete(string data1) public bool EnterNoPersistBlockIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.EnterNoPersistBlock, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = EventOpcode.Info, Task = Tasks.NoPersistBlock, @@ -521,7 +523,7 @@ public void EnterNoPersistBlock() public bool ExitNoPersistBlockIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.ExitNoPersistBlock, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = EventOpcode.Info, Task = Tasks.NoPersistBlock, @@ -534,7 +536,7 @@ public void ExitNoPersistBlock() public bool InArgumentBoundIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFActivities, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFActivities, EventChannel.Debug); } [Event(EventIds.InArgumentBound, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = EventOpcode.Info, Task = Tasks.ExecuteActivity, @@ -547,7 +549,7 @@ public void InArgumentBound(string data1, string data2, string data3, string dat public bool WorkflowApplicationPersistableIdleIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.WorkflowApplicationPersistableIdle, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.WFApplicationStateChangePersistableIdle, Task = Tasks.WFApplicationStateChange, @@ -560,7 +562,7 @@ public void WorkflowApplicationPersistableIdle(string data1, string data2) public bool WorkflowActivityStartIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.WorkflowActivityStart, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = EventOpcode.Start, Task = Tasks.WorkflowActivity, @@ -573,7 +575,7 @@ public void WorkflowActivityStart(Guid Id) public bool WorkflowActivityStopIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.WorkflowActivityStop, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = EventOpcode.Stop, Task = Tasks.WorkflowActivity, @@ -586,7 +588,7 @@ public void WorkflowActivityStop(Guid Id) public bool WorkflowActivitySuspendIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.WorkflowActivitySuspend, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = EventOpcode.Suspend, Task = Tasks.WorkflowActivity, @@ -599,7 +601,7 @@ public void WorkflowActivitySuspend(Guid Id) public bool WorkflowActivityResumeIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.WorkflowActivityResume, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = EventOpcode.Resume, Task = Tasks.WorkflowActivity, @@ -612,7 +614,7 @@ public void WorkflowActivityResume(Guid Id) public bool InvokeMethodIsStaticIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.InvokeMethodIsStatic, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.InvokeMethodIsStatic, Task = Tasks.InvokeMethod, @@ -625,7 +627,7 @@ public void InvokeMethodIsStatic(string data1) public bool InvokeMethodIsNotStaticIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.InvokeMethodIsNotStatic, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.InvokeMethodIsNotStatic, Task = Tasks.InvokeMethod, @@ -638,7 +640,7 @@ public void InvokeMethodIsNotStatic(string data1) public bool InvokedMethodThrewExceptionIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.InvokedMethodThrewException, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.InvokeMethodThrewException, Task = Tasks.InvokeMethod, @@ -651,7 +653,7 @@ public void InvokedMethodThrewException(string data1, string data2) public bool InvokeMethodUseAsyncPatternIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.InvokeMethodUseAsyncPattern, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.InvokeMethodUseAsyncPattern, Task = Tasks.InvokeMethod, @@ -664,7 +666,7 @@ public void InvokeMethodUseAsyncPattern(string data1, string data2, string data3 public bool InvokeMethodDoesNotUseAsyncPatternIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.InvokeMethodDoesNotUseAsyncPattern, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.InvokeMethodDoesNotUseAsyncPattern, Task = Tasks.InvokeMethod, @@ -677,7 +679,7 @@ public void InvokeMethodDoesNotUseAsyncPattern(string data1) public bool FlowchartStartIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFActivities, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFActivities, EventChannel.Debug); } [Event(EventIds.FlowchartStart, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.ExecuteFlowchartBegin, Task = Tasks.ExecuteFlowchart, @@ -690,7 +692,7 @@ public void FlowchartStart(string data1) public bool FlowchartEmptyIsEnabled() { - return IsEnabled(EventLevel.Warning, Keywords.WFActivities, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Warning, Keywords.WFActivities, EventChannel.Debug); } [Event(EventIds.FlowchartEmpty, Level = EventLevel.Warning, Channel = EventChannel.Debug, Opcode = Opcodes.ExecuteFlowchartEmpty, Task = Tasks.ExecuteFlowchart, @@ -703,7 +705,7 @@ public void FlowchartEmpty(string data1) public bool FlowchartNextNullIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFActivities, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFActivities, EventChannel.Debug); } [Event(EventIds.FlowchartNextNull, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.ExecuteFlowchartNextNull, Task = Tasks.ExecuteFlowchart, @@ -716,7 +718,7 @@ public void FlowchartNextNull(string data1) public bool FlowchartSwitchCaseIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFActivities, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFActivities, EventChannel.Debug); } [Event(EventIds.FlowchartSwitchCase, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.ExecuteFlowchartSwitchCase, Task = Tasks.ExecuteFlowchart, @@ -729,7 +731,7 @@ public void FlowchartSwitchCase(string data1, string data2) public bool FlowchartSwitchDefaultIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFActivities, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFActivities, EventChannel.Debug); } [Event(EventIds.FlowchartSwitchDefault, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.ExecuteFlowchartSwitchDefault, Task = Tasks.ExecuteFlowchart, @@ -742,7 +744,7 @@ public void FlowchartSwitchDefault(string data1) public bool FlowchartSwitchCaseNotFoundIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFActivities, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFActivities, EventChannel.Debug); } [Event(EventIds.FlowchartSwitchCaseNotFound, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.ExecuteFlowchartSwitchCaseNotFound, Task = Tasks.ExecuteFlowchart, @@ -755,7 +757,7 @@ public void FlowchartSwitchCaseNotFound(string data1) public bool CompensationStateIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFActivities, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFActivities, EventChannel.Debug); } [Event(EventIds.CompensationState, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = EventOpcode.Info, Task = Tasks.CompensationState, @@ -768,7 +770,7 @@ public void CompensationState(string data1, string data2) public bool SwitchCaseNotFoundIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFActivities, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFActivities, EventChannel.Debug); } [Event(EventIds.SwitchCaseNotFound, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = EventOpcode.Info, Task = Tasks.ExecuteActivity, @@ -781,7 +783,7 @@ public void SwitchCaseNotFound(string data1) public bool ExecuteWorkItemStartIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.ExecuteWorkItemStart, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = EventOpcode.Start, Task = Tasks.ExecuteWorkItem, @@ -794,7 +796,7 @@ public void ExecuteWorkItemStart() public bool ExecuteWorkItemStopIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.ExecuteWorkItemStop, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = EventOpcode.Stop, Task = Tasks.ExecuteWorkItem, @@ -807,7 +809,7 @@ public void ExecuteWorkItemStop() public bool SendMessageChannelCacheMissIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.SendMessageChannelCacheMiss, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = Opcodes.MessageChannelCacheMissed, Task = Tasks.MessageChannelCache, @@ -820,7 +822,7 @@ public void SendMessageChannelCacheMiss() public bool InternalCacheMetadataStartIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.InternalCacheMetadataStart, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = EventOpcode.Start, Task = Tasks.InternalCacheMetadata, @@ -833,7 +835,7 @@ public void InternalCacheMetadataStart(string id) public bool InternalCacheMetadataStopIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.InternalCacheMetadataStop, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = EventOpcode.Stop, Task = Tasks.InternalCacheMetadata, @@ -846,7 +848,7 @@ public void InternalCacheMetadataStop(string id) public bool CompileVbExpressionStartIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.CompileVbExpressionStart, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = EventOpcode.Start, Task = Tasks.VBExpressionCompile, @@ -859,7 +861,7 @@ public void CompileVbExpressionStart(string expr) public bool CacheRootMetadataStartIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.CacheRootMetadataStart, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = EventOpcode.Start, Task = Tasks.CacheRootMetadata, @@ -872,7 +874,7 @@ public void CacheRootMetadataStart(string activityName) public bool CacheRootMetadataStopIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.CacheRootMetadataStop, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = EventOpcode.Stop, Task = Tasks.CacheRootMetadata, @@ -885,7 +887,7 @@ public void CacheRootMetadataStop(string activityName) public bool CompileVbExpressionStopIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.CompileVbExpressionStop, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = EventOpcode.Stop, Task = Tasks.VBExpressionCompile, @@ -898,7 +900,7 @@ public void CompileVbExpressionStop() public bool TryCatchExceptionFromTryIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFActivities, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFActivities, EventChannel.Debug); } [Event(EventIds.TryCatchExceptionFromTry, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.TryCatchExceptionFromTry, Task = Tasks.TryCatchException, @@ -911,7 +913,7 @@ public void TryCatchExceptionFromTry(string data1, string data2) public bool TryCatchExceptionDuringCancelationIsEnabled() { - return IsEnabled(EventLevel.Warning, Keywords.WFActivities, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Warning, Keywords.WFActivities, EventChannel.Debug); } [Event(EventIds.TryCatchExceptionDuringCancelation, Level = EventLevel.Warning, Channel = EventChannel.Debug, Opcode = Opcodes.TryCatchExceptionDuringCancelation, Task = Tasks.TryCatchException, @@ -924,7 +926,7 @@ public void TryCatchExceptionDuringCancelation(string data1) public bool TryCatchExceptionFromCatchOrFinallyIsEnabled() { - return IsEnabled(EventLevel.Warning, Keywords.WFActivities, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Warning, Keywords.WFActivities, EventChannel.Debug); } [Event(EventIds.TryCatchExceptionFromCatchOrFinally, Level = EventLevel.Warning, Channel = EventChannel.Debug, Opcode = Opcodes.TryCatchExceptionFromCatchOrFinally, Task = Tasks.TryCatchException, @@ -937,7 +939,7 @@ public void TryCatchExceptionFromCatchOrFinally(string data1) public bool TrackingRecordDroppedIsEnabled() { - return IsEnabled(EventLevel.Warning, Keywords.WFTracking, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Warning, Keywords.WFTracking, EventChannel.Debug); } [Event(EventIds.TrackingRecordDropped, Level = EventLevel.Warning, Channel = EventChannel.Debug, Opcode = Opcodes.TrackingRecordDropped, Task = Tasks.TrackingRecord, @@ -950,7 +952,7 @@ public void TrackingRecordDropped(long RecordNumber, Guid ProviderId) public bool TrackingRecordRaisedIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Informational, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.TrackingRecordRaised, Level = EventLevel.Informational, Channel = EventChannel.Debug, Opcode = Opcodes.TrackingRecordRaised, Task = Tasks.TrackingRecord, @@ -963,7 +965,7 @@ public void TrackingRecordRaised(string data1, string data2) public bool TrackingRecordTruncatedIsEnabled() { - return IsEnabled(EventLevel.Warning, Keywords.WFTracking, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Warning, Keywords.WFTracking, EventChannel.Debug); } [Event(EventIds.TrackingRecordTruncated, Level = EventLevel.Warning, Channel = EventChannel.Debug, Opcode = Opcodes.TrackingRecordTruncated, Task = Tasks.TrackingRecord, @@ -976,7 +978,7 @@ public void TrackingRecordTruncated(long RecordNumber, Guid ProviderId) public bool TrackingDataExtractedIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Verbose, Keywords.WFRuntime, EventChannel.Debug); } [Event(EventIds.TrackingDataExtracted, Level = EventLevel.Verbose, Channel = EventChannel.Debug, Opcode = EventOpcode.Info, Task = Tasks.TrackingProfile, @@ -989,7 +991,7 @@ public void TrackingDataExtracted(string Data, string Activity) public bool TrackingValueNotSerializableIsEnabled() { - return IsEnabled(EventLevel.Warning, Keywords.WFTracking, EventChannel.Debug); + return IsTracingEnabled(EventLevel.Warning, Keywords.WFTracking, EventChannel.Debug); } [Event(EventIds.TrackingValueNotSerializable, Level = EventLevel.Warning, Channel = EventChannel.Debug, Opcode = EventOpcode.Info, Task = Tasks.TrackingProfile, @@ -1002,7 +1004,7 @@ public void TrackingValueNotSerializable(string name) public bool HandledExceptionIsEnabled() { - return IsEnabled(EventLevel.Informational, Keywords.Infrastructure, EventChannel.Analytic); + return IsTracingEnabled(EventLevel.Informational, Keywords.Infrastructure, EventChannel.Analytic); } [Event(EventIds.HandledException, Level = EventLevel.Informational, Channel = EventChannel.Analytic, @@ -1015,7 +1017,7 @@ public void HandledException(string data1, string SerializedException) public bool ShipAssertExceptionMessageIsEnabled() { - return IsEnabled(EventLevel.Error, Keywords.Infrastructure, EventChannel.Analytic); + return IsTracingEnabled(EventLevel.Error, Keywords.Infrastructure, EventChannel.Analytic); } [Event(EventIds.ShipAssertExceptionMessage, Level = EventLevel.Error, Channel = EventChannel.Analytic, @@ -1028,7 +1030,7 @@ public void ShipAssertExceptionMessage(string data1) public bool ThrowingExceptionIsEnabled() { - return IsEnabled(EventLevel.Warning, Keywords.Infrastructure, EventChannel.Analytic); + return IsTracingEnabled(EventLevel.Warning, Keywords.Infrastructure, EventChannel.Analytic); } [Event(EventIds.ThrowingException, Level = EventLevel.Warning, Channel = EventChannel.Analytic, @@ -1041,7 +1043,7 @@ public void ThrowingException(string data1, string data2, string SerializedExcep public bool UnhandledExceptionIsEnabled() { - return IsEnabled(EventLevel.Critical, Keywords.Infrastructure, EventChannel.Operational); + return IsTracingEnabled(EventLevel.Critical, Keywords.Infrastructure, EventChannel.Operational); } [Event(EventIds.UnhandledException, Level = EventLevel.Critical, Channel = EventChannel.Operational, @@ -1054,7 +1056,7 @@ public void UnhandledException(string data1, string SerializedException) public bool HandledExceptionWarningIsEnabled() { - return IsEnabled(EventLevel.Warning, Keywords.Infrastructure, EventChannel.Analytic); + return IsTracingEnabled(EventLevel.Warning, Keywords.Infrastructure, EventChannel.Analytic); } [Event(EventIds.HandledExceptionWarning, Level = EventLevel.Warning, Channel = EventChannel.Analytic, @@ -1067,7 +1069,7 @@ public void HandledExceptionWarning(string data1, string SerializedException) public bool HandledExceptionErrorIsEnabled() { - return IsEnabled(EventLevel.Error, Keywords.Infrastructure, EventChannel.Operational); + return IsTracingEnabled(EventLevel.Error, Keywords.Infrastructure, EventChannel.Operational); } [Event(EventIds.HandledExceptionError, Level = EventLevel.Error, Channel = EventChannel.Operational, @@ -1080,7 +1082,7 @@ public void HandledExceptionError(string data1, string SerializedException) public bool HandledExceptionVerboseIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.Infrastructure, EventChannel.Analytic); + return IsTracingEnabled(EventLevel.Verbose, Keywords.Infrastructure, EventChannel.Analytic); } [Event(EventIds.HandledExceptionVerbose, Level = EventLevel.Verbose, Channel = EventChannel.Analytic, @@ -1093,7 +1095,7 @@ public void HandledExceptionVerbose(string data1, string SerializedException) public bool ThrowingExceptionVerboseIsEnabled() { - return IsEnabled(EventLevel.Verbose, Keywords.Infrastructure, EventChannel.Analytic); + return IsTracingEnabled(EventLevel.Verbose, Keywords.Infrastructure, EventChannel.Analytic); } [Event(EventIds.ThrowingExceptionVerbose, Level = EventLevel.Verbose, Channel = EventChannel.Analytic, @@ -1104,6 +1106,11 @@ public void ThrowingExceptionVerbose(string data1, string data2, string Serializ WriteEvent(EventIds.ThrowingExceptionVerbose, data1, data2, SerializedException); } + private bool IsTracingEnabled(EventLevel level, EventKeywords keywords, EventChannel channel) + { + return IsWfEtwTracingEnabled && IsEnabled(level, keywords, channel); + } + #region Keywords / Tasks / Opcodes public class EventIds