xref: /freebsd/contrib/ntp/sntp/log.h (revision 2b15cb3d0922bd70ea592f0da9b4a5b167f4d53f)
1*2b15cb3dSCy Schubert #ifndef LOG_H
2*2b15cb3dSCy Schubert #define LOG_H
3*2b15cb3dSCy Schubert 
4*2b15cb3dSCy Schubert #include "ntp.h"
5*2b15cb3dSCy Schubert #include "ntp_stdlib.h"
6*2b15cb3dSCy Schubert #include <stdio.h>
7*2b15cb3dSCy Schubert #include <stdlib.h>
8*2b15cb3dSCy Schubert #include <stdarg.h>
9*2b15cb3dSCy Schubert #include <syslog.h>
10*2b15cb3dSCy Schubert #include <time.h>
11*2b15cb3dSCy Schubert 
12*2b15cb3dSCy Schubert /* syslog as ntpd does, even though we are not a daemon */
13*2b15cb3dSCy Schubert #ifdef LOG_NTP
14*2b15cb3dSCy Schubert # define OPENLOG_FAC	LOG_NTP
15*2b15cb3dSCy Schubert #else
16*2b15cb3dSCy Schubert # ifndef LOG_DAEMON
17*2b15cb3dSCy Schubert #  define LOG_DAEMON	0
18*2b15cb3dSCy Schubert # endif
19*2b15cb3dSCy Schubert # define OPENLOG_FAC	LOG_DAEMON
20*2b15cb3dSCy Schubert #endif
21*2b15cb3dSCy Schubert 
22*2b15cb3dSCy Schubert void sntp_init_logging(const char *program);
23*2b15cb3dSCy Schubert void open_logfile(const char *logfile);
24*2b15cb3dSCy Schubert 
25*2b15cb3dSCy Schubert extern char *progname;		/* for msyslog use too */
26*2b15cb3dSCy Schubert 
27*2b15cb3dSCy Schubert #endif
28