From 0675844956adfd7d227e554d46ba465fade2b2c2 Mon Sep 17 00:00:00 2001 From: Steffen Schulz Date: Fri, 4 Nov 2022 16:46:40 -0700 Subject: [PATCH] Add nyx_warn() and prefix tags Use qemu_log() everywhere so we have a single log on stderr or -D . --- nyx/debug.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nyx/debug.h b/nyx/debug.h index 0aba444f57..3827b64a12 100644 --- a/nyx/debug.h +++ b/nyx/debug.h @@ -24,11 +24,9 @@ #ifdef NYX_DEBUG /* - * qemu_log() is the standard logging enabled with -D + * qemu_log() is the standard logging, forward to file with -D * qemu_log_mask() is activated with additional -t nyx option */ -// #define nyx_debug(format, ...) qemu_log_mask(LOG_NYX, NYX_LOG_PREFIX -// "(%s#:%d)\t"format, __BASE_FILE__, __LINE__, ##__VA_ARGS__) #define nyx_debug(format, ...) \ qemu_log_mask(LOG_NYX, NYX_LOG_PREFIX format, ##__VA_ARGS__) #define nyx_debug_p(PREFIX, format, ...) \ @@ -38,8 +36,9 @@ #define nyx_debug_p(...) #endif -#define nyx_printf(format, ...) qemu_log(format, ##__VA_ARGS__) -#define nyx_error(format, ...) error_printf(format, ##__VA_ARGS__) +#define nyx_printf(format, ...) qemu_log(NYX_LOG_PREFIX format, ##__VA_ARGS__) +#define nyx_error(format, ...) qemu_log(NYX_LOG_PREFIX "Error: " format, ##__VA_ARGS__) +#define nyx_warn(format, ...) qemu_log(NYX_LOG_PREFIX "Warning: " format, ##__VA_ARGS__) #define nyx_trace(format, ...) nyx_debug("=> %s\n", __func__)