Skip to content

Commit

Permalink
refactor(#20): optimized logging warning(s) (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
snovak7 authored Sep 9, 2024
1 parent a803478 commit 87c9b26
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Migrator/MigrationWorkflow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace InfinityFlow.Temporal.Migrator;
/// Migration Workflow.
/// </summary>
[Workflow]
internal class MigrationWorkflow
internal partial class MigrationWorkflow
{
/// <summary>
/// Migration Source.
Expand Down Expand Up @@ -88,10 +88,17 @@ private static async Task ExecuteMigrationAsync(string type, CancellationToken c
}
else
{
Workflow.Logger.LogWarning("No type was found for: {Type}", type);
LogNoTypeFound(Workflow.Logger, type);
}
}

[LoggerMessage(
EventId = 300,
EventName = "No Type Found",
Level = LogLevel.Warning,
Message = "No type was found for: {Type}")]
private static partial void LogNoTypeFound(ILogger logger, string type);

private async Task RunEntryAsync(CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
Expand Down

0 comments on commit 87c9b26

Please sign in to comment.