Jens Axboe | a3d741f | 2008-02-27 18:32:33 +0100 | [diff] [blame] | 1 | #ifndef FIO_LOG_H |
2 | #define FIO_LOG_H | ||||
3 | |||||
4 | extern FILE *f_out; | ||||
5 | extern FILE *f_err; | ||||
6 | |||||
7 | /* | ||||
8 | * If logging output to a file, stderr should go to both stderr and f_err | ||||
9 | */ | ||||
10 | #define log_err(args...) do { \ | ||||
11 | fprintf(f_err, ##args); \ | ||||
12 | if (f_err != stderr) \ | ||||
13 | fprintf(stderr, ##args); \ | ||||
14 | } while (0) | ||||
15 | |||||
16 | #define log_info(args...) fprintf(f_out, ##args) | ||||
17 | |||||
18 | FILE *get_f_out(void); | ||||
19 | FILE *get_f_err(void); | ||||
20 | |||||
21 | #endif |