]> git.proxmox.com Git - mirror_lxc.git/commitdiff
test: improve logging helpers
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 4 Nov 2021 11:13:02 +0000 (12:13 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 4 Nov 2021 13:08:56 +0000 (14:08 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/tests/lxctest.h

index e63936d5f9452e790af2edeba5fd519925e28ad3..fda2821e676540d94a3e38b260fe1df283127b2d 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 
-#define lxc_debug_stream(stream, format, ...)                                  \
-       do {                                                                   \
-               fprintf(stream, "%s: %d: %s: " format "\n", __FILE__, __LINE__,     \
-                       __func__, __VA_ARGS__);                                \
+#define lxc_debug_stream(stream, format, ...)                         \
+       do {                                                          \
+               fprintf(stream, "%s: %d: %s: " format "\n", __FILE__, \
+                       __LINE__, __func__, ##__VA_ARGS__);           \
        } while (false)
 
-#define lxc_error(format, ...) lxc_debug_stream(stderr, format, __VA_ARGS__)
-#define lxc_debug(format, ...) lxc_debug_stream(stdout, format, __VA_ARGS__)
+#define lxc_error(format, ...) lxc_debug_stream(stderr, format, ##__VA_ARGS__)
+#define lxc_debug(format, ...) lxc_debug_stream(stdout, format, ##__VA_ARGS__)
 
 #define lxc_test_assert_stringify(expression, stringify_expression)            \
        do {                                                                   \