4 /* Define syslog style log levels */
5 #define LOGGER_EMERG 0 /* system is unusable */
6 #define LOGGER_ALERT 1 /* action must be taken immediately */
7 #define LOGGER_CRIT 2 /* critical conditions */
8 #define LOGGER_ERR 3 /* error conditions */
9 #define LOGGER_WARNING 4 /* warning conditions */
10 #define LOGGER_NOTICE 5 /* normal but significant condition */
11 #define LOGGER_INFO 6 /* informational */
12 #define LOGGER_DEBUG 7 /* debug-level messages */
14 typedef void (*logger_callback_t
)(int level
, char *msg
);
18 logger_callback_t callback
;
20 typedef struct logger_s logger_t
;
22 void logger_init(logger_t
*logger
);
23 void logger_set_level(logger_t
*logger
, int level
);
24 void logger_set_callback(logger_t
*logger
, logger_callback_t callback
);
26 void logger_log(logger_t
*logger
, int level
, const char *fmt
, ...);