1 #ifndef _LOG_H_ 2 #define _LOG_H_ 3 #include "first.h" 4 5 #include "base_decls.h" 6 #include "buffer.h" 7 8 extern unix_time64_t log_epoch_secs; 9 extern unix_time64_t log_monotonic_secs; 10 11 #if defined(HAVE_CLOCK_GETTIME) && HAS_TIME_BITS64 12 #define log_clock_gettime(clockid,ts) clock_gettime((clockid),(ts)) 13 #define log_clock_gettime_realtime(ts) clock_gettime(CLOCK_REALTIME,(ts)) 14 #else 15 int log_clock_gettime(int clockid, unix_timespec64_t *ts); 16 int log_clock_gettime_realtime (unix_timespec64_t *ts); 17 #endif 18 19 ssize_t write_all(int fd, const void* buf, size_t count); 20 21 __attribute_cold__ 22 __attribute_format__((__printf__, 4, 5)) 23 void log_error(log_error_st *errh, const char *filename, unsigned int line, const char *fmt, ...); 24 25 __attribute_cold__ 26 __attribute_format__((__printf__, 4, 5)) 27 void log_perror(log_error_st *errh, const char *filename, unsigned int line, const char *fmt, ...); 28 29 __attribute_cold__ 30 __attribute_format__((__printf__, 6, 7)) 31 void log_error_multiline(log_error_st *errh, const char *filename, unsigned int line, const char * restrict multiline, const size_t len, const char *fmt, ...); 32 33 __attribute_cold__ 34 __attribute_returns_nonnull__ 35 log_error_st * log_set_global_errh (log_error_st *errh, int ts_high_precision); 36 37 #endif 38