[CRIU] [PATCH 1/2] Introduce log-levels.h

Cyrill Gorcunov gorcunov at openvz.org
Mon Sep 3 04:07:05 EDT 2012


To teach restorer code the log levels we
need a separate file for their definition.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 include/log-levels.h |   10 ++++++++++
 include/log.h        |    8 ++------
 2 files changed, 12 insertions(+), 6 deletions(-)
 create mode 100644 include/log-levels.h

diff --git a/include/log-levels.h b/include/log-levels.h
new file mode 100644
index 0000000..d2aad2e
--- /dev/null
+++ b/include/log-levels.h
@@ -0,0 +1,10 @@
+#ifndef LOG_LEVELS_H__
+#define LOG_LEVELS_H__
+
+#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 */
+
+#endif /* LOG_LEVELS_H__ */
diff --git a/include/log.h b/include/log.h
index 385babb..087d4ae 100644
--- a/include/log.h
+++ b/include/log.h
@@ -1,6 +1,8 @@
 #ifndef LOG_H__
 #define LOG_H__
 
+#include "log-levels.h"
+
 extern int log_init(const char *output);
 extern void log_fini(void);
 extern int log_init_by_pid(void);
@@ -13,12 +15,6 @@ extern void log_set_loglevel(unsigned int loglevel);
 extern void print_on_level(unsigned int loglevel, const char *format, ...)
 	__attribute__ ((__format__ (__printf__, 2, 3)));
 
-#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 */
-
 #ifndef LOG_PREFIX
 # define LOG_PREFIX
 #endif
-- 
1.7.7.6



More information about the CRIU mailing list