Skip to content

Introduce tracing capabilities for debugging rule triggers #31

@mfogliatto

Description

@mfogliatto

Description

We need to introduce tracing capabilities in ReferenceCop to help debug why certain references trigger specific rules. These traces would be left in verbose log files in the output directory for diagnostic purposes.

Problem

Currently, when a rule is triggered, it can be difficult to understand exactly why that happened, especially in complex build scenarios. Better tracing would help users understand and debug rule violations.

Proposed Solution

  1. Add tracing capabilities to the MSBuild task and Roslyn analyzer
  2. Include relevant information in traces (rule details, reference details, context)
  3. Make trace verbosity configurable
  4. Ensure traces appear in a separate log file in a readable format

Implementation Details

  • Consider using the MSBuild logging APIs for the build task
  • Use appropriate diagnostics mechanisms for the Roslyn analyzer
  • Ensure tracing is minimal by default but can be increased for debugging
  • Add clear documentation on how to enable and interpret traces

Acceptance Criteria

  • Traces provide useful information about rule triggers
  • Trace verbosity is configurable
  • Performance impact is minimal when tracing is not enabled
  • Documentation explains how to use the tracing features for debugging

Notes

Not sure yet how much this would be useful, but it could help diagnose issues in complex build scenarios.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions