Skip to content

C# Debug output

Here’s a snippet that I use to push debug output to the console, only when compiled in Debug mode.

private static void DebugOutput(String message)
{
   DebugOutput(message, null);
}

private static void DebugOutput(String message, object details) {

if DEBUG

System.Console.WriteLine(message, details);

endif

}

One Trackback/Pingback

  1. Ed The Dev .com » Blog Archive » Java Debug Output on Friday, April 16, 2010 at April 16

    [...] Here’s my Java version of my previous article about C# Debug Output. [...]