From 92fe2dc01578533a7ecd506ada134b471380a90a Mon Sep 17 00:00:00 2001 From: sanine Date: Fri, 24 Sep 2021 00:04:34 -0500 Subject: update logging to use real functions --- src/logging/logging.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/logging/logging.c') 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 +#include #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); + } +} -- cgit v1.2.1