rspec/rules/S6668/why-dotnet.adoc
github-actions[bot] 761e26c2fd
Create rule S6668: Logging arguments should be passed to the correct parameter (#2530)
Co-authored-by: csaba-sagi-sonarsource <csaba-sagi-sonarsource@users.noreply.github.com>
Co-authored-by: Čaba Šagi <csaba.sagi@sonarsource.com>
Co-authored-by: Costin Zaharia <costin.zaharia@sonarsource.com>
2024-02-29 11:15:41 +01:00

10 lines
726 B
Plaintext

== Why is this an issue?
Most logging frameworks have methods that take a log level, an event ID or an exception as a separate input next to the log format and its arguments. There is a high chance that if the log level, the event ID or the exception are passed as the arguments to the message format, it was a mistake. This rule is going to raise in that scenario.
The rule covers the following logging frameworks:
* Nuget package - https://www.nuget.org/packages/Castle.Core[Castle.Core]
* Nuget package - https://www.nuget.org/packages/Serilog[Serilog]
* Nuget package - https://www.nuget.org/packages/NLog[NLog]
* Nuget package - https://www.nuget.org/packages/Microsoft.Extensions.Logging[Microsoft.Extensions.Logging]