Skip to content

Commit 87c9b26

Browse files
authored
refactor(#20): optimized logging warning(s) (#21)
1 parent a803478 commit 87c9b26

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Migrator/MigrationWorkflow.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace InfinityFlow.Temporal.Migrator;
1616
/// Migration Workflow.
1717
/// </summary>
1818
[Workflow]
19-
internal class MigrationWorkflow
19+
internal partial class MigrationWorkflow
2020
{
2121
/// <summary>
2222
/// Migration Source.
@@ -88,10 +88,17 @@ private static async Task ExecuteMigrationAsync(string type, CancellationToken c
8888
}
8989
else
9090
{
91-
Workflow.Logger.LogWarning("No type was found for: {Type}", type);
91+
LogNoTypeFound(Workflow.Logger, type);
9292
}
9393
}
9494

95+
[LoggerMessage(
96+
EventId = 300,
97+
EventName = "No Type Found",
98+
Level = LogLevel.Warning,
99+
Message = "No type was found for: {Type}")]
100+
private static partial void LogNoTypeFound(ILogger logger, string type);
101+
95102
private async Task RunEntryAsync(CancellationToken cancellationToken)
96103
{
97104
cancellationToken.ThrowIfCancellationRequested();

0 commit comments

Comments
 (0)