+#define __lttng_print(type, fmt, args...) \
+ do { \
+ if (opt_quiet == 0) { \
+ if (type == PRINT_MSG || \
+ ((type & PRINT_DBG) && opt_verbose == 1) || \
+ ((type & (PRINT_DBG | PRINT_DBG2)) && \
+ opt_verbose == 2) || \
+ ((type & (PRINT_DBG | PRINT_DBG2 | PRINT_DBG3)) && \
+ opt_verbose == 3)) { \
+ fprintf(stderr, fmt, ## args); \
+ } else if (type & (PRINT_ERR | PRINT_WARN | PRINT_BUG)) { \
+ fprintf(stderr, fmt, ## args); \
+ } \
+ } \
+ } while (0);
+
+#define MSG(fmt, args...) \
+ __lttng_print(PRINT_MSG, fmt "\n", ## args)
+#define ERR(fmt, args...) \
+ __lttng_print(PRINT_ERR, "Error: " fmt "\n", ## args)
+#define WARN(fmt, args...) \
+ __lttng_print(PRINT_WARN, "Warning: " fmt "\n", ## args)
+#define BUG(fmt, args...) \
+ __lttng_print(PRINT_BUG, "BUG: " fmt "\n", ## args)