ucx/ucx/logging.h

changeset 505
481802342fdf
parent 335
c1bc13faadaa
--- a/ucx/ucx/logging.h	Mon Feb 04 14:11:57 2019 +0100
+++ b/ucx/ucx/logging.h	Mon Feb 04 17:17:48 2019 +0100
@@ -177,6 +177,18 @@
         const unsigned int line, const char* format, ...);
 
 /**
+ * Registers a custom log level.
+ * @param logger the logger
+ * @param level the log level as unsigned integer
+ * @param name a string literal describing the level
+ */
+#define ucx_logger_register_level(logger, level, name) {\
+        unsigned int l; \
+            l = level; \
+            ucx_map_int_put(logger->levels, l, (void*) "[" name "]"); \
+        } while (0);
+
+/**
  * Logs a message at the specified level.
  * @param logger the logger to use
  * @param level the level to log the message on

mercurial