Steeltoe icon indicating copy to clipboard operation
Steeltoe copied to clipboard

Address S106: Standard outputs should not be used directly to log anything

Open bart-vmware opened this issue 3 years ago • 0 comments

Address existing violations of S106: Standard outputs should not be used directly to log anything in the codebase and set severity to Info in Steeltoe.Debug.ruleset and to Warning in Steeltoe.Release.ruleset.

Note: The difference in severities between Debug/Release is to avoid distraction or hindrance while writing/debugging code.

To find existing violations, enable the rule (see above) and rebuild src/Steeltoe.All.sln to make them appear in the Output window.

To address the violations, choose from the following on a case-by-case basis:

  • Remove the offending code
  • Use a different mechanism to write information
  • Consider wrapping the offending code in a #if DEBUG section
  • Suppress the violation in code using #pragma warning disable/restore, preceded by a justification comment

bart-vmware avatar Jul 28 '22 08:07 bart-vmware