From 03b1b38d3d39a60a1e5a27e79a9581a54694a233 Mon Sep 17 00:00:00 2001 From: Martin Costello Date: Tue, 15 Jun 2021 22:56:13 +0100 Subject: [PATCH] Mark logging source generator file as generated (#53275) Give the output file for the M.E.Logging logging classes a ".g" suffix so that it is treated as a generated file to prevent it being flagged by source analyzers for violations the application developer cannot fix for themselves. --- .../gen/LoggerMessageGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/LoggerMessageGenerator.cs b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/LoggerMessageGenerator.cs index 73ca6a7..92105d5 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/LoggerMessageGenerator.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/LoggerMessageGenerator.cs @@ -39,7 +39,7 @@ namespace Microsoft.Extensions.Logging.Generators var e = new Emitter(); string result = e.Emit(logClasses, context.CancellationToken); - context.AddSource("LoggerMessage", SourceText.From(result, Encoding.UTF8)); + context.AddSource("LoggerMessage.g.cs", SourceText.From(result, Encoding.UTF8)); } } -- 2.7.4