Debugging KPilot conduits is not an easy task, as one cannot use a debugger (because conduits are shared libraries and kpilotDaemon forks itself in the background when it is started).
So printing debug output is the only way to get any information about what the conduit is doing. If you don't configure kdepim it with -no-debug, or don't add -NDEBUG in Makefile.am, then you can easily print out debug messages using the DEBUGCONDUIT stream. However, at the beginning of each function where you want to use it, you need to add the macro FUNCTIONSETUP;, which prints out a debug message with the current function name. Additionally, it sets several variables like fname which holds the name of the current function.
As an example, the following code
void YourConduit::somefunction() {
FUNCTIONSETUP;
int i=5;
#ifdef DEBUG
DEBUGCONDUIT<<fname<<": Value of i="<<i<<endl;
#endif
}
prints out the following debug message to stdout:
kpilotdaemon: somefunction: Value of i=5