Open mpidash opened 3 months ago
cc @stephentoub @Youssef1313 (thanks for providing the prototype 👍)
Attention: Patch coverage is 84.32432%
with 29 lines
in your changes missing coverage. Please review.
Project coverage is 96.51%. Comparing base (
43709af
) to head (fbf9763
).
I skimmed through them and could not find any false positives.
Thanks. The LoggerExtensions.cs ones are all false positives in that we'll want to suppress them, but that's also effectively the implementation of logging rather than consumption of logging, and we frequently have to suppress rules in such implementations. The others for runtime look like valid diagnostics.
Fixes https://github.com/dotnet/runtime/issues/78402.
This analyzer detects
ILogger.Log
,Microsoft.Extensions.Logging.LoggerExtensions
and[LoggerMessage]
and flags them if they evaluate expensive arguments without checking if logging is enabled with
ILogger.IsEnabled
.There are 12 findings in
dotnet/runtime
(8 of them inMicrosoft.Extensions.Logging.Abstractions
which will probably disable this warning), 157 findings indotnet/roslyn
and 497 indotnet/aspnetcore
(including testing code). I skimmed through them and could not find any false positives.