FastFsm.Sharp.Logging
0.9.0
See the version list below for details.
dotnet add package FastFsm.Sharp.Logging --version 0.9.0
NuGet\Install-Package FastFsm.Sharp.Logging -Version 0.9.0
<PackageReference Include="FastFsm.Sharp.Logging" Version="0.9.0" />
<PackageVersion Include="FastFsm.Sharp.Logging" Version="0.9.0" />
<PackageReference Include="FastFsm.Sharp.Logging" />
paket add FastFsm.Sharp.Logging --version 0.9.0
#r "nuget: FastFsm.Sharp.Logging, 0.9.0"
#:package FastFsm.Sharp.Logging@0.9.0
#addin nuget:?package=FastFsm.Sharp.Logging&version=0.9.0
#tool nuget:?package=FastFsm.Sharp.Logging&version=0.9.0
Logging
Install the logging package:
dotnet add package FastFsm.Sharp.Logging
The package sets FsmGenerateLogging=true and defines FSM_LOGGING_ENABLED. Generated machines then include the logging-specific constructor parameter and lifecycle logging code.
Project-reference configuration
When using project references inside this repository, enable logging generation with:
<PropertyGroup>
<FsmGenerateLogging>true</FsmGenerateLogging>
</PropertyGroup>
The FastFsm.Sharp.Logging package props set this property for package consumers.
Constructor injection
var logger = loggerFactory.CreateLogger<DoorController>();
var door = new DoorController(DoorState.Closed, logger: logger);
door.Start();
door.Fire(DoorTrigger.Open);
Event categories
Generated logging includes events for:
- machine start and stop
- transition start, success, and failure
- guard evaluation
OnEntry,OnExit, and action execution- unhandled triggers
- hierarchy-specific processing when HSM support is enabled
Event IDs and templates are defined by the logging source generator in Generator.Logger.
Extensions and logging
When FSM_LOGGING_ENABLED is active, exceptions caught while invoking extension hooks can be reported through the generated logging path. Extension behavior is defined by IStateMachineExtension implementations.
Tests
Tests.Logging (src/Fsm/Fsm.Tests/Tests.Logging/) contains logging integration tests and the Attribute/Fluent parity matrix (DualApiMatrixTests).
Related
- extensions.md — extension hooks
- getting-started.md — package installation
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- FastFsm.Sharp (>= 0.9.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on FastFsm.Sharp.Logging:
| Package | Downloads |
|---|---|
|
FastFsm.Net.Logging
Legacy package ID. Depends on FastFsm.Sharp.Logging. New projects should reference FastFsm.Sharp.Logging directly. |
GitHub repositories
This package is not used by any popular GitHub repositories.
.NET 10 logging package for FastFsm.Sharp. Depends on FastFsm.Sharp. See CHANGELOG.md.