Use message templates in ILogger calls

Proprietary

Replace interpolated or concatenated messages passed to Microsoft.Extensions.Logging Log* methods with a constant message template and arguments (CA2254). This keeps the values available to structured logging providers and avoids formatting the message when the log level is disabled.

OpenRewrite.Recipes.CSharp.CodeQuality.Logging.UseLoggingMessageTemplates
mod run . --recipe=OpenRewrite.Recipes.CSharp.CodeQuality.Logging.UseLoggingMessageTemplates

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.