void log_msg(int level, const char *fmt, ...) { va_list arg; va_start(arg, fmt); log_doit(level, 0, 0, fmt, arg); va_end(arg); }
void log_msg(const char *fmt, ...) { va_list ap; va_start(ap, fmt); log_doit(0, LOG_ERR, fmt, ap); va_end(ap); }
void log_err(int level, int error, const char *fmt, ...) { va_list arg; va_start(arg, fmt); log_doit(level, 1, error, fmt, arg); va_end(arg); }
void log_sys(const char *fmt, ...) { va_list ap; va_start(ap, fmt); log_doit(1, LOG_ERR, fmt, ap); va_end(ap); exit(2); }
/*Nonfatal error related to a system call. Print a message with the system's errno value and return */ void log_ret(const char *fmt, ...) { va_list ap; va_start(ap, fmt); log_doit(1, LOG_ERR, fmt, ap); va_end(ap); return; }
void log_error(const char *format, ...) { va_list ap; va_start(ap, format); log_doit(0, LOG_ERROR, format, ap); va_end(ap); }
void log_info(const char *format, ...) { va_list ap; va_start(ap, format); log_doit(0, LOG_INFO, format, ap); va_end(ap); }
/* * fatel error related to system call. * Erroe number passed as an explicit parameter. * Print a message and terminate */ void log_exit(int error, const char *fmt, ...) { va_list ap; va_start(ap, fmt); log_doit(1, error, LOG_ERR, fmt, ap); va_end(ap); exit(2); }
/* * Fatal error unrelated to a system call. * Print a message and terminate. */ void log_quit(const char *fmt, ...) { va_list ap; va_start(ap, fmt); log_doit(0, fmt, ap); va_end(ap); exit(2); }