Skip to content

Commit 882106d

Browse files
Code review 4
1 parent d22f181 commit 882106d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

rules/S6675/rule.adoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ Moreover, unlike `Trace.TraceError`, `Trace.WriteLineIf(switch.TraceError, ...)`
1414

1515
== How to fix it
1616

17-
The fix depends on the intent behind the use of https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.traceswitch[`TraceSwitch`] levels with https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.writelineif[`Trace.WriteLineIf`]:
17+
The fix depends on the intent behind the use of https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.traceswitch[`TraceSwitch`] levels with https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.writelineif[`Trace.WriteLineIf`].
1818

19-
* if it is *trace categorization*, level-specific tracing methods, such as https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceerror[`Trace.TraceError`] or https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.tracewarning[`Trace.TraceWarning]`, should be used instead
20-
* if it is *trace filtering*, https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracesource[`TraceSource`] should be used instead
21-
* if it is *log filtering*, `Trace` should be replaced by logging APIs, such as the https://learn.microsoft.com/en-us/dotnet/core/diagnostics/logging-tracing#net-logging-apis[`ILogger` API]
19+
If it is *trace categorization*, level-specific tracing methods, such as https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.traceerror[`Trace.TraceError`] or https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.trace.tracewarning[`Trace.TraceWarning]`, should be used instead.
20+
21+
If it is *trace filtering*, https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.tracesource[`TraceSource`] should be used instead.
22+
23+
If it is *log filtering*, `Trace` should be replaced by logging APIs, such as the https://learn.microsoft.com/en-us/dotnet/core/diagnostics/logging-tracing#net-logging-apis[`ILogger` API].
2224

2325
Modern logging APIs are also more suitable than `Trace` when https://learn.microsoft.com/en-us/dotnet/core/extensions/high-performance-logging[high-performance logging] is required.
2426

0 commit comments

Comments
 (0)