diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/log.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -11,10 +11,12 @@ static struct { struct list logl; bool debug; + bool info; bool stder; } lg = { LIST_INIT, false, + true, true }; @@ -43,6 +45,12 @@ void log_enable_debug(bool enable) } +void log_enable_info(bool enable) +{ + lg.info = enable; +} + + void log_enable_stderr(bool enable) { lg.stder = enable; @@ -90,6 +98,9 @@ void loglv(enum log_level level, const char *fmt, ...) if ((LEVEL_DEBUG == level) && !lg.debug) return; + if ((LEVEL_INFO == level) && !lg.info) + return; + va_start(ap, fmt); vlog(level, fmt, ap); va_end(ap); @@ -113,6 +124,9 @@ void info(const char *fmt, ...) { va_list ap; + if (!lg.info) + return; + va_start(ap, fmt); vlog(LEVEL_INFO, fmt, ap); va_end(ap); |