Outputing Custom Columns

Top  Previous  Next

This example shows how to output custom columns for the MS Windows Debug Viewer tool, which will automatically create custom columns for you.  You will find this demo project in the DebugLibrary source code directory, along with project files for ms .net2003,vc6, and dev-c++.

 

//---------------------------------------------------------------------------

// System includes for std::cout usage below

#include <iostream>

//---------------------------------------------------------------------------

 

//---------------------------------------------------------------------------

// Include the Debugging Library file (only our main should include this

//  file, additional .cpp files should include "jrdebug.h"

//  alternatively, you could add this cpp to your project or makefile.

#include "../../jrdebug_main.cpp"

//---------------------------------------------------------------------------

 

 

//---------------------------------------------------------------------------

int main(int argc, char *argv[])

{

 // start

 int count;

 int max=20;

 

 // loop - note the custom column headers |*COLUMNNAME*| value

 for (count=1;count<=max;++count)

         dbprintf(JrdMessage,"test #%d of %d |*CustomTestNum*| 1",count,max);

 for (count=1;count<=max;++count)

         dbprintf(JrdWarning,"test #%d of %d |*CustomTestNum*| 2",count,max);

 for (count=1;count<=max;++count)

         dbprintf(JrdError,"test #%d of %d |*CustomTestNum*| 3",count,max);

 for (count=1;count<=max;++count)

         dbprintf(JrdNote,"test #%d of %d |*CustomTestNum*| 4",count,max);

 for (count=1;count<=max;++count)

         dbprintf(JrdTest,"test #%d of %d |*CustomTestNum*| 5",count,max);

 for (count=1;count<=max;++count)

         dbprintf(JrdCustom,"test #%d of %d |*CustomTestNum*| 6",count,max);

 

 // return success

 std::cout << "Program has finished."<<std::endl;

 return 0;

}

//---------------------------------------------------------------------------