12 void log_msg(char *message
, char type
) {
14 time_t cur_time
= time(NULL
);
15 char *timestamp
= ctime(&cur_time
);
17 fprintf(log_file
, "%s: %s\n", timestamp
, message
);
27 type
= LOG_DEBUG
| LOG_CONS
;
31 type
= LOG_WARNING
| LOG_CONS
;
35 syslog(type
, message
);
39 void debug_msg(char *message
) {
40 if(HAVE_OPT(FILELOG
)) {
41 time_t cur_time
= time(NULL
);
42 char *timestamp
= ctime(&cur_time
);
44 fprintf(stderr
, "%s: %s\n", timestamp
, message
);
61 log_file
= fopen(logfile
, "a");
62 if (log_file
== NULL
) {
65 snprintf(error_msg
, 80, "init_log(): Cannot open logfile %s", logfile
);
76 void cleanup_log(void) {