[3/3] criu: derive log levels from compel

Submitted by Kir Kolyshkin on Feb. 10, 2017, 4:03 a.m.

Details

Message ID 20170210040350.19023-4-kir@openvz.org
State New
Series "log level cleanups"
Headers show

Commit Message

Kir Kolyshkin Feb. 10, 2017, 4:03 a.m.
criu and compel are using same values for log levels. For example,
it makes it possible for criu to use its own loglevel to set the
log level for compel.

Instead of pretending it's just a coincidence, let criu derive
log levels from compel.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
---
 criu/include/log.h | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/include/log.h b/criu/include/log.h
index 9c4c283..62868f6 100644
--- a/criu/include/log.h
+++ b/criu/include/log.h
@@ -2,6 +2,7 @@ 
 #define __CR_LOG_H__
 
 #include <inttypes.h>
+#include <compel/loglevels.h>
 
 #ifndef CR_NOGLIBC
 
@@ -15,11 +16,13 @@  extern void vprint_on_level(unsigned int loglevel, const char *format,
 #endif /* CR_NOGLIBC */
 
 #define LOG_UNSET	(-1)
-#define LOG_MSG		(0) /* Print message regardless of log level */
-#define LOG_ERROR	(1) /* Errors only, when we're in trouble */
-#define LOG_WARN	(2) /* Warnings, dazen and confused but trying to continue */
-#define LOG_INFO	(3) /* Informative, everything is fine */
-#define LOG_DEBUG	(4) /* Debug only */
+
+/* Derive the values from compel */
+#define LOG_MSG		COMPEL_LOG_MSG
+#define LOG_ERROR	COMPEL_LOG_ERROR
+#define LOG_WARN	COMPEL_LOG_WARN
+#define LOG_INFO	COMPEL_LOG_INFO
+#define LOG_DEBUG	COMPEL_LOG_DEBUG
 
 #define DEFAULT_LOGLEVEL	LOG_WARN