4 /* The deprecated global variables: */
14 /* Log settings checking macros: */
16 /* Returns true if qemu_log() will really write somewhere
18 #define qemu_log_enabled() (logfile != NULL)
20 /* Returns true if a bit is set in the current loglevel mask
22 #define qemu_loglevel_mask(b) ((loglevel & (b)) != 0)
25 /* Logging functions: */
27 /* main logging function
29 #define qemu_log(...) do { \
31 fprintf(logfile, ## __VA_ARGS__); \
34 /* vfprintf-like logging function
36 #define qemu_log_vprintf(fmt, va) do { \
38 vfprintf(logfile, fmt, va); \
41 /* log only if a bit is set on the current loglevel mask
43 #define qemu_log_mask(b, ...) do { \
45 fprintf(logfile, ## __VA_ARGS__); \
53 /* cpu_dump_state() logging functions: */
54 #define log_cpu_state(env, f) cpu_dump_state((env), logfile, fprintf, (f));
55 #define log_cpu_state_mask(b, env, f) do { \
56 if (loglevel & (b)) log_cpu_state((env), (f)); \
59 /* disas() and target_disas() to logfile: */
60 #define log_target_disas(start, len, flags) \
61 target_disas(logfile, (start), (len), (flags))
62 #define log_disas(start, len) \
63 disas(logfile, (start), (len))
65 /* page_dump() output to the log file: */
66 #define log_page_dump() page_dump(logfile)
72 /* fflush() the log file */
73 #define qemu_log_flush() fflush(logfile)
75 /* Close the log file */
76 #define qemu_log_close() do { \
81 /* Set up a new log file */
82 #define qemu_log_set_file(f) do { \
86 /* Set up a new log file, only if none is set */
87 #define qemu_log_try_set_file(f) do { \