The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/3318

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
From a1162a6ce7d8390d5224edf298dd0cf13733c66e Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brau...@ubuntu.com>
Date: Fri, 20 Mar 2020 22:02:12 +0100
Subject: [PATCH] log: fix cmd logging

Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
---
 src/lxc/log.h | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/lxc/log.h b/src/lxc/log.h
index 7bd3556a8e..d280656241 100644
--- a/src/lxc/log.h
+++ b/src/lxc/log.h
@@ -456,27 +456,28 @@ __lxc_unused static inline void LXC_##LEVEL(struct 
lxc_log_locinfo* locinfo,      \
 #endif
 
 #if HAVE_M_FORMAT
-#define CMD_SYSERROR(format, ...)                                            \
-       fprintf(stderr, "%m - %s: %d: %s: " format "\n", __FILE__, __LINE__, \
+#define CMD_SYSERROR(format, ...)                                             \
+       fprintf(stderr, "%s: %d: %s - %m - " format "\n", __FILE__, __LINE__, \
                __func__, ##__VA_ARGS__);
 #else
-#define CMD_SYSERROR(format, ...)                                          \
-       do {                                                               \
-               lxc_log_strerror_r;                                        \
-               fprintf(stderr, "%s - %s: %d: %s: " format "\n", __FILE__, \
-                       __LINE__, __func__, ptr, ##__VA_ARGS__);           \
+#define CMD_SYSERROR(format, ...)                                           \
+       do {                                                                \
+               lxc_log_strerror_r;                                         \
+               fprintf(stderr, "%s: %d: %s - %s - " format "\n", __FILE__, \
+                       __LINE__, __func__, ptr, ##__VA_ARGS__);            \
        } while (0)
 #endif
 
 #if HAVE_M_FORMAT
-#define CMD_SYSINFO(format, ...)                            \
-               printf("%m - " format, ##__VA_ARGS__)
+#define CMD_SYSINFO(format, ...)                                               
\
+       printf("%s: %d: %s - %m - " format "\n", __FILE__, __LINE__, __func__, \
+              ##__VA_ARGS__);
 #else
-#define CMD_SYSINFO(format, ...)                                            \
-       do {                                                                \
-               lxc_log_strerror_r;                                         \
-               prinft("%s - %s: %d: %s: " format "\n", __FILE__, __LINE__, \
-                      __func__, ptr, ##__VA_ARGS__);                       \
+#define CMD_SYSINFO(format, ...)                                             \
+       do {                                                                 \
+               lxc_log_strerror_r;                                          \
+               printf("%s: %d: %s - %s - " format "\n", __FILE__, __LINE__, \
+                      __func__, ptr, ##__VA_ARGS__);                        \
        } while (0)
 #endif
 
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to