diff options
Diffstat (limited to 'helper.c')
-rw-r--r-- | helper.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -11,6 +11,8 @@ #include <fcntl.h> #include <stdarg.h> +DebugLevel _debugLevel = DEBUG_WARNING; + void bail(char *args, ...) { printf("ERROR: "); @@ -201,3 +203,13 @@ void helper_printfilter(struct Filter* f) putchar('\n'); } +void plog(const DebugLevel debugLevel, char *args, ...) +{ + if (debugLevel < _debugLevel) return; + va_list argList; + va_start(argList, args); + vprintf(args, argList); + va_end(argList); + putchar('\n'); + fflush(stdout); +} |