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
messagestringThe message to log.
logLevelWorkflowForgeLogLevelThe log level to use.
namestringOptional name for the operation.
Properties
Name
Gets the name of this operation for identification and logging purposes.
public override string Name { get; }
Property Value
Methods
Critical(string)
Creates a critical-level logging operation.
public static LoggingOperation Critical(string message)
Parameters
messagestringThe message to log.
Returns
- LoggingOperation
A logging operation.
Debug(string)
Creates a debug-level logging operation.
public static LoggingOperation Debug(string message)
Parameters
messagestringThe message to log.
Returns
- LoggingOperation
A logging operation.
Error(string)
Creates an error-level logging operation.
public static LoggingOperation Error(string message)
Parameters
messagestringThe 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
inputDataobjectThe input data for the operation.
foundryIWorkflowFoundryThe workflow foundry providing context and services.
cancellationTokenCancellationTokenThe cancellation token.
Returns
Info(string)
Creates an info-level logging operation.
public static LoggingOperation Info(string message)
Parameters
messagestringThe message to log.
Returns
- LoggingOperation
A logging operation.
Trace(string)
Creates a trace-level logging operation.
public static LoggingOperation Trace(string message)
Parameters
messagestringThe message to log.
Returns
- LoggingOperation
A logging operation.
Warning(string)
Creates a warning-level logging operation.
public static LoggingOperation Warning(string message)
Parameters
messagestringThe message to log.
Returns
- LoggingOperation
A logging operation.