xref: /freebsd/contrib/ntp/sntp/log.h (revision 9034852c84a13f0e3b5527e1c886ca94b2863b2b)
12b15cb3dSCy Schubert #ifndef LOG_H
22b15cb3dSCy Schubert #define LOG_H
32b15cb3dSCy Schubert 
42b15cb3dSCy Schubert #include "ntp.h"
52b15cb3dSCy Schubert #include "ntp_stdlib.h"
62b15cb3dSCy Schubert #include <stdio.h>
72b15cb3dSCy Schubert #include <stdlib.h>
82b15cb3dSCy Schubert #include <stdarg.h>
92b15cb3dSCy Schubert #include <syslog.h>
102b15cb3dSCy Schubert #include <time.h>
112b15cb3dSCy Schubert 
122b15cb3dSCy Schubert /* syslog as ntpd does, even though we are not a daemon */
132b15cb3dSCy Schubert #ifdef LOG_NTP
142b15cb3dSCy Schubert # define OPENLOG_FAC	LOG_NTP
152b15cb3dSCy Schubert #else
162b15cb3dSCy Schubert # ifndef LOG_DAEMON
172b15cb3dSCy Schubert #  define LOG_DAEMON	0
182b15cb3dSCy Schubert # endif
192b15cb3dSCy Schubert # define OPENLOG_FAC	LOG_DAEMON
202b15cb3dSCy Schubert #endif
212b15cb3dSCy Schubert 
222b15cb3dSCy Schubert void sntp_init_logging(const char *program);
232b15cb3dSCy Schubert void open_logfile(const char *logfile);
242b15cb3dSCy Schubert 
25*9034852cSGleb Smirnoff extern char const *progname;		/* for msyslog use too */
262b15cb3dSCy Schubert 
272b15cb3dSCy Schubert #endif
28