I created my own C library, which my employees intend to use. In this shell I intend to use syslogand depending on the input parameter, I want to switch between LOCAL0and LOCAL1.
The easiest way to find openlog()with LOCAL0or LOCAL1, depending on the input parameter, and then do syslog()`closelog ().
I have all 3 in one API (something similar below):
void syslog_wrap_api(int flag, const char *msg)
{
setlogmask(LOG_UPTO (LOG_INFO));
if(flag == 0)
openlog("myapplog",LOG_NDELAY,LOG_LOCAL0);
else
openlog("myapplog",LOG_NDELAY,LOG_LOCAL1);
syslog(LOG_INFO,"%s",msg);
closelog()
}
My question is: can this API cause stress problems (performance issues)?
source
share