public static void AddTraceActionForEntry(this WorkflowState state)
        {
            var action = new TraceAction {
                Message = $"Entering state '{state.DisplayName}'"
            };

            state.EntryActions.Add(action);
        }
        public static void AddTraceAction(this WorkflowTransition transition)
        {
            var action = new TraceAction {
                Message = $"Executing transition '{transition.DisplayName}'"
            };

            transition.Actions.Add(action);
        }
Example #3
0
 /// <summary>
 /// Créer un TraceWrapper de trace quand on dispose des informations détaillées
 /// </summary>
 public TraceWrapper(TraceEventCache eventCache, string source, TraceEventType eventType, int identifier, string message, params object[] traceData)
 {
     EventCache = eventCache;
     EventType  = eventType;
     Identifier = identifier;
     Message    = message;
     TraceData  = traceData;
     Source     = source;
     Action     = TraceAction.Trace;
 }
Example #4
0
        private async Task ExceptionHandlerAsync(ExceptionReceivedEventArgs exceptionReceivedEventArgs)
        {
            var text = new StringBuilder();

            try
            {
                text.AppendLine($"Message handler encountered an exception {exceptionReceivedEventArgs.Exception}.");
                var context = exceptionReceivedEventArgs.ExceptionReceivedContext;
                text.AppendLine("Exception context for troubleshooting:");
                text.AppendLine($"- Endpoint: {context.Endpoint}");
                text.AppendLine($"- Entity Path: {context.EntityPath}");
                text.AppendLine($"- Executing Action: {context.Action}");
            }
            finally
            {
                TraceAction?.Invoke(text.ToString());
            }
            await Task.CompletedTask;
        }
Example #5
0
 public void Trace(string message)
 {
     TraceAction?.Invoke(message);
 }
Example #6
0
 /// <summary>
 /// Creates a new instance of an asynchronous delegate tracer
 /// </summary>
 /// <param name="errorAction">Action for error messages</param>
 /// <param name="warnAction">Action for warning messages</param>
 /// <param name="infoAction">Action for information messages</param>
 public AsyncDelegateTracer(TraceAction errorAction, TraceAction warnAction, TraceCategorizedAction infoAction) : base(errorAction, warnAction, infoAction)
 {
     // not used
 }
Example #7
0
 /// <summary>
 /// Creates a new instance of a delegate tracer
 /// </summary>
 /// <param name="errorAction">Action for error messages</param>
 /// <param name="warnAction">Action for warning messages</param>
 /// <param name="infoAction">Action for information messages</param>
 public DelegateTracer(TraceAction errorAction, TraceAction warnAction, TraceCategorizedAction infoAction)
 {
     this.ErrorTraceAction = errorAction;
     this.WarnTraceAction  = warnAction;
     this.InfoTraceAction  = infoAction;
 }
Example #8
0
 /// <summary>
 /// créer un TraceWrapper qui demande de forcer le flush des traces
 /// </summary>
 public TraceWrapper()
 {
     Action = TraceAction.ForceFlush;
 }