A First Example

Top  Previous  Next

Here's a complete simple .cpp program that demonstates the basic logging commands.

 

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

// 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 and

//   then just include "jrdebug.h" here, which is a more standard approach.

#include "jrdebug_main.cpp"

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

 

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

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

{

 // C++ iostreams style logging:

 debugout << "Main started with argc = "<<argc;

 // printf style logging:

 dbprintf("Main started with argc=%d",argc);

 // return success

 return 0;

}

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