Table of Contents

Class WorkflowForgeLoggerExtensions

Namespace
WorkflowForge.Extensions
Assembly
WorkflowForge.dll

Extension methods for creating standardized logging scopes and property dictionaries.

public static class WorkflowForgeLoggerExtensions
Inheritance
WorkflowForgeLoggerExtensions
Inherited Members

Methods

CreateCompensationResultProperties(IWorkflowForgeLogger, int, int)

Builds standardized compensation result property dictionary.

public static Dictionary<string, string> CreateCompensationResultProperties(this IWorkflowForgeLogger _, int successCount, int failureCount)

Parameters

_ IWorkflowForgeLogger

Unused logger parameter to provide extension method shape.

successCount int

Successful compensations.

failureCount int

Failed compensations.

Returns

Dictionary<string, string>

Dictionary of logging properties.

CreateCompensationScope(IWorkflowForgeLogger, int)

Creates a compensation logging scope with standardized properties.

public static IDisposable CreateCompensationScope(this IWorkflowForgeLogger logger, int operationCount)

Parameters

logger IWorkflowForgeLogger

WorkflowForge logger.

operationCount int

Number of operations to compensate.

Returns

IDisposable

A disposable logging scope.

CreateErrorProperties(IWorkflowForgeLogger, Exception, string?)

Builds standardized error property dictionary for logging exceptions.

public static Dictionary<string, string> CreateErrorProperties(this IWorkflowForgeLogger _, Exception exception, string? category = null)

Parameters

_ IWorkflowForgeLogger

Unused logger parameter to provide extension method shape.

exception Exception

Exception to describe.

category string

Optional error category label.

Returns

Dictionary<string, string>

Dictionary of logging properties.

CreateOperationScope(IWorkflowForgeLogger, IWorkflowOperation, int, object?)

Creates an operation execution logging scope with standardized properties.

public static IDisposable CreateOperationScope(this IWorkflowForgeLogger logger, IWorkflowOperation operation, int stepIndex, object? inputData = null)

Parameters

logger IWorkflowForgeLogger

WorkflowForge logger.

operation IWorkflowOperation

Operation being executed.

stepIndex int

Step index in the workflow.

inputData object

Optional input data for context.

Returns

IDisposable

A disposable logging scope.

CreateWorkflowScope(IWorkflowForgeLogger, IWorkflow, IWorkflowFoundry)

Creates a workflow execution logging scope with standardized properties.

public static IDisposable CreateWorkflowScope(this IWorkflowForgeLogger logger, IWorkflow workflow, IWorkflowFoundry foundry)

Parameters

logger IWorkflowForgeLogger

WorkflowForge logger.

workflow IWorkflow

Workflow being executed.

foundry IWorkflowFoundry

Foundry context.

Returns

IDisposable

A disposable logging scope.