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); }
/// <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; }
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; }
public void Trace(string message) { TraceAction?.Invoke(message); }
/// <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 }
/// <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; }
/// <summary> /// créer un TraceWrapper qui demande de forcer le flush des traces /// </summary> public TraceWrapper() { Action = TraceAction.ForceFlush; }