1.1 --- a/src/ucx/logging.h Fri May 11 18:46:31 2018 +0200 1.2 +++ b/src/ucx/logging.h Fri May 11 19:48:19 2018 +0200 1.3 @@ -177,6 +177,18 @@ 1.4 const unsigned int line, const char* format, ...); 1.5 1.6 /** 1.7 + * Registers a custom log level. 1.8 + * @param logger the logger 1.9 + * @param level the log level as unsigned integer 1.10 + * @param name a string literal describing the level 1.11 + */ 1.12 +#define ucx_logger_register_level(logger, level, name) {\ 1.13 + unsigned int l; \ 1.14 + l = level; \ 1.15 + ucx_map_int_put(logger->levels, l, (void*) "[" name "]"); \ 1.16 + } while (0); 1.17 + 1.18 +/** 1.19 * Logs a message at the specified level. 1.20 * @param logger the logger to use 1.21 * @param level the level to log the message on