Replace Debug.WriteLine
- Dominant language
- C#
- Stars
- 183
- Forks
- 160
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 15
Description
`Debug.WriteLine` is only there in debug session, but the information it prints could be useful in other scenarios, such as production debugging. Some alternatives, in increasing order of preference:
1. [Trace.TraceInformation](https://msdn.microsoft.com/en-us/library/system.diagnostics.trace.traceinformation(v=vs.110).aspx) / [Trace.TraceWarning](https://msdn.microsoft.com/en-us/library/system.diagnostics.trace.tracewarning(v=vs.110).aspx) / [Trace.TraceError](https://msdn.microsoft.com/en-us/library/system.diagnostics.trace.traceerror(v=vs.110).aspx).
2. Same as above but using your own [TraceSource](https://msdn.microsoft.com/en-us/library/system.diagnostics.tracesource(v=vs.110).aspx)
3. [EventSource](https://msdn.microsoft.com/en-us/library/system.diagnostics.tracing.eventsource(v=vs.110).aspx) (ETW).
Contributor guide
Research direction
Start with a repository-wide search for `Debug.WriteLine` and review each usage in context. Compare the listed `Trace` and `EventSource` alternatives, choose an approach that supports production diagnostics, and verify that the relevant debug output has been replaced without losing useful information.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- observability
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100