]> the.earth.li Git - onak.git/commitdiff
Add getlogthreshold() to obtain current log level setting
authorJonathan McDowell <noodles@earth.li>
Tue, 7 Jun 2016 12:49:59 +0000 (13:49 +0100)
committerJonathan McDowell <noodles@earth.li>
Tue, 7 Jun 2016 14:19:28 +0000 (15:19 +0100)
log.c
log.h

diff --git a/log.c b/log.c
index 7b17cb0d4191dc209fc1014a5c58df35f5d836c8..8ab5e96526b916283efe06e01b966c9eed7534d0 100644 (file)
--- a/log.c
+++ b/log.c
@@ -111,6 +111,17 @@ loglevels setlogthreshold(loglevels loglevel)
        return oldlevel;
 }
 
+/*
+ *     getlogthreshold - get the threshold for log output
+ *
+ *     Returns the threshold for log output; anything logged with a log level
+ *     lower than this will be silently dropped.
+ */
+loglevels getlogthreshold(void)
+{
+       return logthres;
+}
+
 /*
  *     vflog - write a log entry to an already opened log file.
  *      @logfile: The FILE * handle of the open log file.
diff --git a/log.h b/log.h
index 77770bc1abc67d0a6acfda5845363b7ac939e729..867d6ea4e52ead5e51da35451c803b31d51f9755 100644 (file)
--- a/log.h
+++ b/log.h
@@ -88,6 +88,14 @@ void cleanuplogthing(void);
  */
 loglevels setlogthreshold(loglevels loglevel);
 
+/*
+ *     getlogthreshold - get the threshold for log output
+ *
+ *     Returns the threshold for log output; anything logged with a log level
+ *     lower than this will be silently dropped.
+ */
+loglevels getlogthreshold(void);
+
 /*
  *     logthing - output a log entry
  *      @loglevel: The level of the log.