-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add logger for each action so we can trace breadcrumbs
- Loading branch information
1 parent
6557e64
commit 1718de3
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Diagnostics; | ||
using Fluxor; | ||
using LiftLog.Ui.Services; | ||
using Microsoft.AspNetCore.Components; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace LiftLog.Ui.Store; | ||
|
||
public class LogActionMiddleware(ILogger<LogActionMiddleware> logger) : Middleware | ||
{ | ||
public override void BeforeDispatch(object action) | ||
{ | ||
logger.LogInformation("Dispatching action {Action}", action?.GetType()); | ||
base.BeforeDispatch(action); | ||
} | ||
|
||
public override void AfterDispatch(object action) | ||
{ | ||
logger.LogInformation("Action {Action} dispatched", action?.GetType()); | ||
base.AfterDispatch(action); | ||
} | ||
} |