Table of Contents

Class LoggingOperation

Namespace
WorkflowForge.Operations
Assembly
WorkflowForge.dll

Simple logging operation for debugging and workflow tracking. Provides structured logging with properties for better observability.

public sealed class LoggingOperation : WorkflowOperationBase, IWorkflowOperation, IDisposable
Inheritance
LoggingOperation
Implements
Inherited Members
Extension Methods

Constructors

LoggingOperation(string, WorkflowForgeLogLevel, string?)

Initializes a new logging operation.

public LoggingOperation(string message, WorkflowForgeLogLevel logLevel = WorkflowForgeLogLevel.Information, string? name = null)

Parameters

message string

The message to log.

logLevel WorkflowForgeLogLevel

The log level to use.

name string

Optional name for the operation.

Properties

Name

Gets the name of this operation for identification and logging purposes.

public override string Name { get; }

Property Value

string

Methods

Critical(string)

Creates a critical-level logging operation.

public static LoggingOperation Critical(string message)

Parameters

message string

The message to log.

Returns

LoggingOperation

A logging operation.

Debug(string)

Creates a debug-level logging operation.

public static LoggingOperation Debug(string message)

Parameters

message string

The message to log.

Returns

LoggingOperation

A logging operation.

Error(string)

Creates an error-level logging operation.

public static LoggingOperation Error(string message)

Parameters

message string

The message to log.

Returns

LoggingOperation

A logging operation.

ForgeAsyncCore(object?, IWorkflowFoundry, CancellationToken)

Core operation logic. Implement this method with your operation's business logic. This is called between OnBeforeExecuteAsync and OnAfterExecuteAsync.

protected override Task<object?> ForgeAsyncCore(object? inputData, IWorkflowFoundry foundry, CancellationToken cancellationToken = default)

Parameters

inputData object

The input data for the operation.

foundry IWorkflowFoundry

The workflow foundry providing context and services.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<object>

The output data from the operation.

Info(string)

Creates an info-level logging operation.

public static LoggingOperation Info(string message)

Parameters

message string

The message to log.

Returns

LoggingOperation

A logging operation.

Trace(string)

Creates a trace-level logging operation.

public static LoggingOperation Trace(string message)

Parameters

message string

The message to log.

Returns

LoggingOperation

A logging operation.

Warning(string)

Creates a warning-level logging operation.

public static LoggingOperation Warning(string message)

Parameters

message string

The message to log.

Returns

LoggingOperation

A logging operation.