log.c: New functions to hide access to quiet and silent flags

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-07-02 12:42:44 +02:00
1 parent 60df2f2ea9
commit cd947a69a8
6 files changed
+24 -13

No files matched your search

+15
View File
@@ -31,6 +31,8 @@
#include "log.h"
static int debug = 0;
static int quiet = QUIET_MODE; /* Delayed disable of silent mode. */
static int silent = SILENT_MODE; /* Completely silent, including boot */
static int loglevel = LOG_NOTICE;
void log_init(int qit, int dbg)
@@ -53,6 +55,19 @@ void log_exit(void)
}
}
void log_silent(void)
{
if (quiet && !debug)
silent = 1;
else
silent = 0;
}
int log_is_silent(void)
{
return silent;
}
void log_debug(void)
{
debug = !debug;