summaryrefslogtreecommitdiff
path: root/log.h
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-02-27 18:32:33 +0100
committerJens Axboe <jens.axboe@oracle.com>2008-02-27 18:32:33 +0100
commita3d741fa3bc3120d5b62a56826a97524daa32803 (patch)
tree9f792474e4cbca062176a7a7788a9691cfdfbf7d /log.h
parentc0a5d35ec77fae5cfe382d35ab18915ed6766504 (diff)
downloadfio-a3d741fa3bc3120d5b62a56826a97524daa32803.tar.gz
Add --debug=parse for option parsing debug
Adds log.h and debug.h to split the logging and debug bits out of fio, so that the parser can use them. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'log.h')
-rw-r--r--log.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/log.h b/log.h
new file mode 100644
index 00000000..12c9a552
--- /dev/null
+++ b/log.h
@@ -0,0 +1,21 @@
+#ifndef FIO_LOG_H
+#define FIO_LOG_H
+
+extern FILE *f_out;
+extern FILE *f_err;
+
+/*
+ * If logging output to a file, stderr should go to both stderr and f_err
+ */
+#define log_err(args...) do { \
+ fprintf(f_err, ##args); \
+ if (f_err != stderr) \
+ fprintf(stderr, ##args); \
+ } while (0)
+
+#define log_info(args...) fprintf(f_out, ##args)
+
+FILE *get_f_out(void);
+FILE *get_f_err(void);
+
+#endif