dotnet/runtime
在 GitHub 查看[Analyzer] Replacing direct LoggerExtensions.Log* usage with source-generated logging methods
Open
#78,406 创建于 2022年11月15日
api-approvedarea-Extensions-Loggingcode-analyzercode-fixerhelp wantedpartner-impact
仓库指标
- Star
- (17,886 star)
- 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)