Don’t forget to turn off your debug prints when you ship your product

One thing that really annoys me when I am debugging a problem is when people ship their products with debug prints on in the release versions.

This just sucks, it really does.  It’s hard to pay attention to debug prints for things that matter if half of the third party software on your computer is compiled with debug prints enabled.  One example of a particularly annoying offender of this is the HGFS (host-guest filesystem) network filesystem provider shipped by VMware.  Now, I love VMware, but it’s really, really annoying that every single VM in existance with VMware Tools installed has built in debug print spam from every process that touches the network provider stack.

So, change those DbgPrint calls to KdPrint if you are working on a driver, and if you’re in user mode, make sure that OutputDebugString calls aren’t compiled in if you are in release mode.  Alternatively, leave them there but make sure that they are off by default unless you set a special configuration or registry parameter.

2 Responses to “Don’t forget to turn off your debug prints when you ship your product”

  1. bugcheck says:

    ditto…. those damn vmware tools drive me CRAZY. Also I believe you have a typo and you ment change DbgPrint to KdPrint right?
    #if DBG
    #define KdPrint(_x_) DbgPrint _x_
    #define KdBreakPoint() DbgBreakPoint()
    #define KdBreakPointWithStatus(s) DbgBreakPointWithStatus(s)
    #else
    #define KdPrint(_x_)
    #define KdBreakPoint()
    #define KdBreakPointWithStatus(s)
    #endif

  2. Skywing says:

    Fixed now, good catch. That’s what I get for writing articles at 2am…