| 1 | #ifndef FIO_LOG_H |
| 2 | #define FIO_LOG_H |
| 3 | |
| 4 | #include <stdio.h> |
| 5 | #include <stdarg.h> |
| 6 | |
| 7 | extern FILE *f_out; |
| 8 | extern FILE *f_err; |
| 9 | |
| 10 | extern int log_err(const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); |
| 11 | extern int log_info(const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); |
| 12 | extern int log_local(const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); |
| 13 | extern int log_valist(const char *str, va_list); |
| 14 | extern int log_local_buf(const char *buf, size_t); |
| 15 | extern int log_info_flush(void); |
| 16 | |
| 17 | enum { |
| 18 | FIO_LOG_DEBUG = 1, |
| 19 | FIO_LOG_INFO = 2, |
| 20 | FIO_LOG_ERR = 3, |
| 21 | FIO_LOG_NR = 4, |
| 22 | }; |
| 23 | |
| 24 | extern const char *log_get_level(int level); |
| 25 | |
| 26 | #endif |