Getting Started Creating Log Messages Using the API – C

C and C++ API Reference, Samples

Logging from C code requires three simple steps:

1)  Copy the header and library files (PB.h and PB*.lib) from the installation directory to the INCLUDE and LIB paths. (There are no associated DLLs – the C/C++ API is implemented in static libraries.)

2)  Add the #include <PB.h> directive to your code. (Note that PB.h will automatically instruct the linker which libraries to link in, avoiding the need for manually changing any project settings.)

3)  Add logging calls as desired.

Sample

#include <PB.h>

VOID main(INT argc, CHAR* argv[])
{
/*
* Note that PBLog() uses printf() formatting.
*/
PBLog(NULL, NULL, PB_WARNING, "This program (%s) does nothing.", argv[0]);
}