[CRIU] [PATCH 2/4] log: Add log_get_loglevel() helper

Cyrill Gorcunov gorcunov at openvz.org
Mon Sep 3 06:14:13 EDT 2012


Will need it to fetch log level for restorer code.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 include/log.h |    1 +
 log.c         |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/log.h b/include/log.h
index 087d4ae..24d69dd 100644
--- a/include/log.h
+++ b/include/log.h
@@ -11,6 +11,7 @@ extern void log_closedir(void);
 extern int log_get_fd(void);
 
 extern void log_set_loglevel(unsigned int loglevel);
+extern unsigned int log_get_loglevel(void);
 
 extern void print_on_level(unsigned int loglevel, const char *format, ...)
 	__attribute__ ((__format__ (__printf__, 2, 3)));
diff --git a/log.c b/log.c
index 8abdba9..d9a36f1 100644
--- a/log.c
+++ b/log.c
@@ -130,6 +130,11 @@ void log_set_loglevel(unsigned int level)
 		current_loglevel = level;
 }
 
+unsigned int log_get_loglevel(void)
+{
+	return current_loglevel;
+}
+
 void print_on_level(unsigned int loglevel, const char *format, ...)
 {
 	va_list params;
-- 
1.7.7.6



More information about the CRIU mailing list