summaryrefslogtreecommitdiff
path: root/src/logging/logging.c
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2021-09-24 00:04:34 -0500
committersanine <sanine.not@pm.me>2021-09-24 00:04:34 -0500
commit92fe2dc01578533a7ecd506ada134b471380a90a (patch)
treef4abc20d0ed92d3bc248f5068d82106d9ef2f99d /src/logging/logging.c
parent921f1a46bbccbdf9dcadbd7017ec0c575d2bed1f (diff)
update logging to use real functions
Diffstat (limited to 'src/logging/logging.c')
-rw-r--r--src/logging/logging.c20
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);
+ }
+}