I\'m often frustrated by the System.Diagnostics.Debug.Write/WriteLine methods. I would like to use the Write/WriteLine methods familiar from the TextWriter class, so I ofte
Do you particularly need a whole TextWriter? While this is somewhat "quick and dirty" I suspect a static class with just a few methods would do perfectly well:
public static class DebugEx
{
[Conditional("DEBUG")]
public static void WriteLine(string format, params object[] args)
{
Debug.WriteLine(string.Format(format, args));
}
}
or something similar.
Mind you, I'd personally look at something like log4net to give more control over the output.