Closed j2jensen closed 6 years ago
If the logging methods would be annotated with Serilog.Core.MessageTemplateFormatMethodAttribute
like in https://github.com/serilog/serilog/blob/2d4d8d13cffe33e5c72e6c6f4a29f84aaba8f5a3/src/Serilog/ILogger.cs#L93-L100 then it would be recognized automatically.
Very nice. I've created an Issue to ask if they can add those annotations.
The annotation is added, and everything works as expected. Thanks!
The Anotar.Serilog.Fody package allows you to write code like this:
And have it compile to something like this:
I'm switching from using Anotar.Log4Net to Serilog right now, and I love that this analyzer can warn me about common mistakes, but I would love to get the concise code and extra context that Anotar.Serilog provides. Since the
Anotar.Serilog.LogTo
static methods seem to mirror those ofSerilog.Log
, it seems like it might be an easy lift to make these analyzers provide the same analyses that they provide for Serilog.