Create rule S6675

This commit is contained in:
antonioaversa 2023-07-20 11:35:12 +00:00 committed by Zsolt Kolbay
parent 4ec4bb3f9d
commit 07a6a39e92
3 changed files with 4 additions and 2 deletions

View File

@ -13,7 +13,7 @@
"constantCost": "5min"
},
"tags": [
"confusing",
"confusing",
"clumsy",
"logging"
],

View File

@ -4,7 +4,7 @@ The https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.writel
https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.traceswitch[`TraceSwitch`] allows trace control via `bool` properties for each relevant https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracelevel[`TraceLevel`], such as https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.traceswitch.traceerror[`TraceSwitch.TraceError`].
Using `Trace.WriteLineIf` with such properties should be avoided since it can lead to misinterpretation and produce confusion.
Using `Trace.WriteLineIf` with such properties should be avoided since it can lead to misinterpretation and produce confusion.
In particular, `Trace.WriteLineIf` may appear as equivalent to the level-specific tracing methods provided by `Trace`, such as https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceerror[`Trace.Error`], but it is not.

View File

@ -0,0 +1,2 @@
{
}