From 1ca109e1770b56095bdf4c664f3b99b7ac93776d Mon Sep 17 00:00:00 2001 From: sanine Date: Thu, 23 Sep 2021 23:11:23 -0500 Subject: add honey_log_level_str_() --- src/logging/logging.c | 33 +++++++++++++++++++++++++++++++++ src/logging/logging.h | 10 ++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/logging/logging.c create mode 100644 src/logging/logging.h (limited to 'src/logging') diff --git a/src/logging/logging.c b/src/logging/logging.c new file mode 100644 index 0000000..429f222 --- /dev/null +++ b/src/logging/logging.c @@ -0,0 +1,33 @@ +#include + +#include "logging/logging.h" + + +const char * honey_log_level_str_(struct honey_log_info *info) +{ + switch(info->log_level) { + case DEBUG: + return "DEBUG"; + break; + + case INFO: + return "INFO"; + break; + + case WARN: + return "WARN"; + break; + + case ERROR: + return "ERROR"; + break; + + case FATAL: + return "FATAL"; + break; + + default: + return NULL; + break; + } +} diff --git a/src/logging/logging.h b/src/logging/logging.h new file mode 100644 index 0000000..87436e5 --- /dev/null +++ b/src/logging/logging.h @@ -0,0 +1,10 @@ +#ifndef HONEY_LOGGING_H +#define HONEY_LOGGING_H + +struct honey_log_info { + enum { DEBUG, INFO, WARN, ERROR, FATAL } log_level; +}; + +const char * honey_log_level_str_(struct honey_log_info *info); + +#endif -- cgit v1.2.1