It is best to use the same journal library that you mentioned, but with codes specific to the OS (for example: line number, file name, sequential messages), separately from the logical code. OS-specific code must be contained in functions or macros and then called from a logical code.
Example:
int log(void)
{
char msg[50];
sprintf(msg, "line %i, %s", OS_LINE, OS_FILE);
OS_SEND(msg);
return 0;
}
With this, you can reuse the library simply by changing the Mac OS for each device.
source
share