some-usable-scripts/c/libipc/example-syslog.c
Philippe PITTOLI e9576b5574 adding C tests
2020-01-28 12:41:11 +01:00

23 lines
427 B
C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
int main(int argc, char * argv[])
{
argc = argc; // warnings
argv = argv; // warnings
setlogmask (LOG_UPTO (LOG_NOTICE));
openlog ("exampleprog", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
syslog (LOG_NOTICE, "Program started by User %d", 1000);
syslog (LOG_INFO, "A tree falls in a forest");
closelog ();
return EXIT_SUCCESS;
}