![]() |
||||||||
|
|
||||||||
// this is needed in every sourcefile using zoidcom #include <zoidcom.h> int main() { // create ZoidCom with logging disabled ZoidCom *zcom = new ZoidCom(); if (!zcom) exit(255); // initialize if (!zcom->Init()) exit(255); // here Zoidcom can be used // remove it again delete zcom; }
There are three constructors for ZoidCom, one has no parameters, another one accepts a filename as logoutput, and the last one accepts a function pointer as logoutput. With latter one, you can hook Zoidcom into your own logging facilities and apply filters, or just write it out to a file yourself.
Note that it is essential to delete all ZCom_Control instances before deleting the ZoidCom object, because ZCom_Control needs ZoidCom to operate.
void process_zoidcom_log(const char *_log) { printf("%s\n", _log); }
And then during Zoidcom init:
This will give all logs to the function process_zoidcom_log() which in turn prints them to standard output.
1.4.6-NO