From 26842ff3833c853e3e3cef065a494c05736a53e5 Mon Sep 17 00:00:00 2001 From: David Eklov Date: Mon, 27 Jun 2016 02:29:37 -0500 Subject: Add get_log_level() to encapsulate v (current log level) This patch also makes all global variable in log.c static. --- common/log.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/log.c b/common/log.c index ef791bec..56c3834a 100644 --- a/common/log.c +++ b/common/log.c @@ -12,9 +12,9 @@ #include #include -int colored = 1; -log_importance_t loglevel_default = L_ERROR; -log_importance_t v = L_SILENT; +static int colored = 1; +static log_importance_t loglevel_default = L_ERROR; +static log_importance_t v = L_SILENT; static const char *verbosity_colors[] = { [L_SILENT] = "", @@ -38,6 +38,10 @@ void set_log_level(log_importance_t verbosity) { v = verbosity; } +log_importance_t get_log_level(void) { + return v; +} + void reset_log_level(void) { v = loglevel_default; } -- cgit v1.2.3-54-g00ecf