log.c revision 1.6
1/*	$NetBSD: log.c,v 1.6 2013/12/28 03:20:15 christos Exp $	*/
2
3#include <config.h>
4
5#include "log.h"
6
7char *progname;		/* for msyslog use too */
8
9static void cleanup_log(void);
10
11void
12sntp_init_logging(
13	const char *prog
14	)
15{
16	msyslog_term = TRUE;
17	init_logging(prog, 0, FALSE);
18	msyslog_term_pid = FALSE;
19	msyslog_include_timestamp = FALSE;
20}
21
22void
23open_logfile(
24	const char *logfile
25	)
26{
27	change_logfile(logfile, FALSE);
28	atexit(cleanup_log);
29}
30
31
32static void
33cleanup_log(void)
34{
35	syslogit = TRUE;
36	fflush(syslog_file);
37	fclose(syslog_file);
38	syslog_file = NULL;
39}
40