Reproduce and Fix a Bug with Guided Logging

Use Copilot to isolate bugs by adding targeted logging and diagnostic output.

category:debugging
logging
bugfix
workflow
multi-step
0

Prompt

A workflow designed to quickly identify hidden bugs by adding structured logs and using Copilot to interpret them.

## Steps:

1. Document the bug: expected vs actual result.

2. Ask Copilot: "Suggest where to add logging to diagnose this bug."

3. Insert targeted logs.

4. Reproduce the issue and capture logs.

5. Ask Copilot: "Based on these logs, where is the bug located?"

6. Apply the fix.

7. Ask Copilot: "Write a regression test for this bug."

8. Clean up logs after verifying the fix.