Add internal bt_common_logging_level_string()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 15 Jun 2019 01:14:06 +0000 (21:14 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 20 Jun 2019 18:01:16 +0000 (14:01 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I6fd26a0657d93efc8a30d6055d755c5e2b852f2e
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1453
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/common/common.h

index 570eec67cbe51d5d94db8370693a3eba2807d1ba..c62da1a3b80d214c03c7e1014541549327cfb941 100644 (file)
@@ -37,6 +37,7 @@
 #include <babeltrace2/trace-ir/event-class-const.h>
 #include <babeltrace2/trace-ir/field-class-const.h>
 #include <babeltrace2/trace-ir/field-path-const.h>
+#include <babeltrace2/logging.h>
 #include <babeltrace2/value.h>
 
 #include "common/assert.h"
@@ -562,6 +563,30 @@ const char *bt_common_self_message_iterator_status_string(
        }
 };
 
+static inline
+const char *bt_common_logging_level_string(
+               enum bt_logging_level level)
+{
+       switch (level) {
+       case BT_LOGGING_LEVEL_VERBOSE:
+               return "BT_LOGGING_LEVEL_VERBOSE";
+       case BT_LOGGING_LEVEL_DEBUG:
+               return "BT_LOGGING_LEVEL_DEBUG";
+       case BT_LOGGING_LEVEL_INFO:
+               return "BT_LOGGING_LEVEL_INFO";
+       case BT_LOGGING_LEVEL_WARN:
+               return "BT_LOGGING_LEVEL_WARN";
+       case BT_LOGGING_LEVEL_ERROR:
+               return "BT_LOGGING_LEVEL_ERROR";
+       case BT_LOGGING_LEVEL_FATAL:
+               return "BT_LOGGING_LEVEL_FATAL";
+       case BT_LOGGING_LEVEL_NONE:
+               return "BT_LOGGING_LEVEL_NONE";
+       default:
+               return "(unknown)";
+       }
+};
+
 #define NS_PER_S_I     INT64_C(1000000000)
 #define NS_PER_S_U     UINT64_C(1000000000)
 
This page took 0.025695 seconds and 4 git commands to generate.