aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-06-27 20:05:11 -0400
committerGitHub <noreply@github.com>2016-06-27 20:05:11 -0400
commitb5d778dd828f8a772373931adaf10152f7db5854 (patch)
treed576aeed92f5819b1e873539e6151509eeec529d /common
parent8f67903909dc542c9137bd8168967ca1f788b11e (diff)
parent26842ff3833c853e3e3cef065a494c05736a53e5 (diff)
Merge pull request #728 from deklov/master
Add get_log_level() to encapsulate v (current log level)
Diffstat (limited to 'common')
-rw-r--r--common/log.c10
1 files changed, 7 insertions, 3 deletions
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 <string.h>
#include <stringop.h>
-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;
}