dotnet/runtime

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

開放

#78,406 建立於 2022年11月15日

 (11 則留言) (3 個反應) (0 位負責人)C# (5,445 個分叉)batch import
api-approvedarea-Extensions-Loggingcode-analyzercode-fixerhelp wantedpartner-impact

倉庫指標

星標
 (17,886 顆星)
PR 合併指標
 (平均合併 12天 11小時) (30 天內合併 661 個 PR)

描述

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)

貢獻者指南