summaryrefslogtreecommitdiff
path: root/sntp/log.h
diff options
context:
space:
mode:
Diffstat (limited to 'sntp/log.h')
-rw-r--r--sntp/log.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/sntp/log.h b/sntp/log.h
new file mode 100644
index 0000000..fdb2ba2
--- /dev/null
+++ b/sntp/log.h
@@ -0,0 +1,27 @@
+#ifndef LOG_H
+#define LOG_H
+
+#include "ntp.h"
+#include "ntp_stdlib.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <syslog.h>
+#include <time.h>
+
+/* syslog as ntpd does, even though we are not a daemon */
+#ifdef LOG_NTP
+# define OPENLOG_FAC LOG_NTP
+#else
+# ifndef LOG_DAEMON
+# define LOG_DAEMON 0
+# endif
+# define OPENLOG_FAC LOG_DAEMON
+#endif
+
+void sntp_init_logging(const char *program);
+void open_logfile(const char *logfile);
+
+extern char *progname; /* for msyslog use too */
+
+#endif