Since I am now starting the synth at boot time, all my logs are going to stdout and it is hard to figure out what is happening when things go wrong. Also printf seem to affect synth performance. For both those reasons, I decided to use syslog for my run time logs. This is what I did:
1. Initialized logs doing:
setlogmask (LOG_UPTO (LOG_DEBUG));
openlog ("mysynth", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_USER);
2. Replaced printfs with one of the following macro calls:
#define ERROR_LOG(...) \
syslog(LOG_ERR, __VA_ARGS__)
#define INFO_LOG(...) \
syslog(LOG_INFO, __VA_ARGS__)
#define WARNING_LOG(...) \
syslog(LOG_WARNING, __VA_ARGS__)