From: Martin Costello Date: Tue, 15 Jun 2021 21:56:13 +0000 (+0100) Subject: Mark logging source generator file as generated (#53275) X-Git-Tag: submit/tizen/20210909.063632~745 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=03b1b38d3d39a60a1e5a27e79a9581a54694a233;p=platform%2Fupstream%2Fdotnet%2Fruntime.git 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. --- 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)); } }