monitor/qmp: Update comment for commit 4eaca8de268
[qemu/armbru.git] / include / qemu / log-for-trace.h
blob2f0a5b080eabd6f26b390e9ee6f4c2fba8ff5935
1 /* log-for-trace.h: logging basics required by the trace.h generated
2 * by the log trace backend.
4 * This should not be included directly by any .c file: if you
5 * need to use the logging functions include "qemu/log.h".
7 * The purpose of splitting these parts out into their own header
8 * is to catch the easy mistake where a .c file includes trace.h
9 * but forgets to include qemu/log.h. Without this split, that
10 * would result in the .c file compiling fine when the default
11 * trace backend is in use but failing to compile with any other
12 * backend.
14 * This code is licensed under the GNU General Public License,
15 * version 2 or (at your option) any later version.
18 #ifndef QEMU_LOG_FOR_TRACE_H
19 #define QEMU_LOG_FOR_TRACE_H
21 /* Private global variable, don't use */
22 extern int qemu_loglevel;
24 #define LOG_TRACE (1 << 15)
26 /* Returns true if a bit is set in the current loglevel mask */
27 static inline bool qemu_loglevel_mask(int mask)
29 return (qemu_loglevel & mask) != 0;
32 /* main logging function */
33 int GCC_FMT_ATTR(1, 2) qemu_log(const char *fmt, ...);
35 #endif