diff options
Diffstat (limited to 'src/logging/logging.c')
-rw-r--r-- | src/logging/logging.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/logging/logging.c b/src/logging/logging.c index 429f222..77c648c 100644 --- a/src/logging/logging.c +++ b/src/logging/logging.c @@ -1,11 +1,15 @@ #include <stdio.h> +#include <stdarg.h> #include "logging/logging.h" -const char * honey_log_level_str_(struct honey_log_info *info) +struct honey_log_info_t honey_log_info; + + +const char * honey_log_level_str() { - switch(info->log_level) { + switch(honey_log_info.log_level) { case DEBUG: return "DEBUG"; break; @@ -31,3 +35,15 @@ const char * honey_log_level_str_(struct honey_log_info *info) break; } } + + +void honey_debug(const char *fmt, ...) +{ + if (honey_log_info.log_level >= DEBUG) { + va_list args; + va_start(args, fmt); + fprintf(honey_log_info.debug_out, "[DEBUG] "); + vfprintf(honey_log_info.debug_out, fmt, args); + va_end(args); + } +} |