From 252f4d4b16eee6e61f0675f65069216cc37805c4 Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Tue, 7 Jun 2016 13:49:59 +0100 Subject: [PATCH] Add getlogthreshold() to obtain current log level setting --- log.c | 11 +++++++++++ log.h | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/log.c b/log.c index 7b17cb0..8ab5e96 100644 --- 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 77770bc..867d6ea 100644 --- 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. -- 2.39.5