dotnet/runtime

[Analyzer] Replacing direct LoggerExtensions.Log* usage with source-generated logging methods

オープン

#78,406 opened on 2022/11/15

 (11 件のコメント) (3 件のリアクション) (0 人の担当者)C# (5,445 件のフォーク)batch import
api-approvedarea-Extensions-Loggingcode-analyzercode-fixerhelp wantedpartner-impact

Repository metrics

Stars
 (17,886 個のスター)
PR merge metrics
 (平均マージ 12d 11h) (30d で 661 merged PRs)

説明

Just as we have a regex source generator analyzer that flags use of Regex and creates a replacement that uses the source generator, we should consider an analyzer that will push code to use the logging source generator. The analyzer would flag direct use of LoggerExtensions.Log* methods and recommend replacing them with use of the logging generator, with the fixer generating a partial method stub for the generator and changing the call site to use it.

Performance rules Category Severity = none (off by default)

コントリビューターガイド