src/ucx/logging.h

changeset 295
7fc65395188e
parent 259
2f5dea574a75
child 376
028039652b86
equal deleted inserted replaced
294:bfa935ab7f85 295:7fc65395188e
175 */ 175 */
176 void ucx_logger_logf(UcxLogger *logger, unsigned int level, const char* file, 176 void ucx_logger_logf(UcxLogger *logger, unsigned int level, const char* file,
177 const unsigned int line, const char* format, ...); 177 const unsigned int line, const char* format, ...);
178 178
179 /** 179 /**
180 * Registers a custom log level.
181 * @param logger the logger
182 * @param level the log level as unsigned integer
183 * @param name a string literal describing the level
184 */
185 #define ucx_logger_register_level(logger, level, name) {\
186 unsigned int l; \
187 l = level; \
188 ucx_map_int_put(logger->levels, l, (void*) "[" name "]"); \
189 } while (0);
190
191 /**
180 * Logs a message at the specified level. 192 * Logs a message at the specified level.
181 * @param logger the logger to use 193 * @param logger the logger to use
182 * @param level the level to log the message on 194 * @param level the level to log the message on
183 * @param ... format string and arguments 195 * @param ... format string and arguments
184 * @see ucx_logger_logf() 196 * @see ucx_logger_logf()

mercurial