Suchiman / SerilogAnalyzer

Roslyn-based analysis for code using the Serilog logging library. Checks for common mistakes and usage problems.
Apache License 2.0
309 stars 29 forks source link

Does this project is still maintained? #62

Open ProximaB opened 1 year ago

Suchiman commented 1 year ago

I still take care of the project, and am using it myself extensively, making sure it continues to function, however i didn't have much time or inspiration to work on new stuff so it has been maintenance only for a while.

ProximaB commented 1 year ago

I'm wondering if it could be converted to official serilog analyzer nuget. That could ensure more people benefit from it and help to maintain the project. https://github.com/serilog/serilog/issues/1938

Suchiman commented 1 year ago

There used to be talk about doing that in the past with @nblumhardt, including shipping the analyzer in the box, but the discussion about that died down with the current state having been good enough. I'm still open to the idea of shipping it inbox if there's renewed interest in doing so.

nblumhardt commented 1 year ago

I'm still interested in this also, though it's nontrivial work :-)

We'd need to be careful up-front to focus on the most important analyses, and ship them incrementally/conservatively, to make sure we didn't regress people's experience.

Rider now includes some basic message template analyses by default (without any plug-ins):

image

Missing parameters are detected:

image

But other important analyses - like non-constant message templates, and use of interpolated strings, aren't:

image

Rider's analysis also doesn't integrate with MSBuild, so it's easy to miss warnings, especially in team environments.

I spotted your ticket over in the Serilog repo, @ProximaB - thanks for the note over there. Perhaps the way forward would be to sketch things out a little more over there? I think it'd be useful to start with a list of targeted analyses - ones with a very low false-positive rate, such as:

(Any others come to mind?)

I'd expect that there's a lot of inspiration to be gained from SerilogAnalyzer, but I think we'd want to start with something cut-down, and revisit questions like whether VB.NET should be supported, consider updates for nullable reference types is, etc.

Because it's a lot of work, we'd need some indication up front of who would be keen to drive it through to completion :)

Bit of a brain-dump, but hope this helps :-)