Skip to content

Commit 03b1b38

Browse files
authoredJun 15, 2021
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.
1 parent b21ac01 commit 03b1b38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/LoggerMessageGenerator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void Execute(GeneratorExecutionContext context)
3939
var e = new Emitter();
4040
string result = e.Emit(logClasses, context.CancellationToken);
4141

42-
context.AddSource("LoggerMessage", SourceText.From(result, Encoding.UTF8));
42+
context.AddSource("LoggerMessage.g.cs", SourceText.From(result, Encoding.UTF8));
4343
}
4444
}
4545

0 commit comments

Comments
 (0)
Please sign in to comment.