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