2021-02-09 18:48:50 +01:00
|
|
|
#define _DEFAULT_SOURCE
|
2021-02-09 18:47:20 +01:00
|
|
|
|
2021-02-09 18:32:58 +01:00
|
|
|
#include <syslog.h>
|
|
|
|
#include <stdarg.h>
|
2021-02-09 19:17:14 +01:00
|
|
|
// #include <stdio.h>
|
2021-02-09 18:32:58 +01:00
|
|
|
|
|
|
|
void logmsg(int prio, const char* format, ...) {
|
|
|
|
va_list vl;
|
|
|
|
|
2021-02-10 18:23:18 +01:00
|
|
|
openlog("counter", 0, LOG_LOCAL1);
|
2021-02-09 18:32:58 +01:00
|
|
|
va_start(vl, format);
|
2021-02-09 19:17:14 +01:00
|
|
|
vsyslog(prio, format, vl);
|
|
|
|
//vprintf(format, vl);
|
2021-02-09 18:32:58 +01:00
|
|
|
va_end(vl);
|
2021-02-09 19:17:14 +01:00
|
|
|
closelog();
|
2021-02-09 18:32:58 +01:00
|
|
|
}
|
|
|
|
|