2013-05-01 14:52:55 +02:00
|
|
|
#ifndef __CAPWAP_LOGGING_HEADER__
|
|
|
|
#define __CAPWAP_LOGGING_HEADER__
|
|
|
|
|
2016-03-30 14:29:53 +02:00
|
|
|
#include <syslog.h>
|
|
|
|
|
2013-05-01 14:52:55 +02:00
|
|
|
/* Logging level */
|
2016-03-30 14:29:53 +02:00
|
|
|
#define LOG_NONE -1
|
2016-02-29 14:23:58 +01:00
|
|
|
|
2013-05-01 14:52:55 +02:00
|
|
|
/* Logging initialize function */
|
|
|
|
void capwap_logging_init();
|
|
|
|
void capwap_logging_close();
|
|
|
|
|
|
|
|
/* */
|
2016-03-30 14:29:53 +02:00
|
|
|
void capwap_logging_verboselevel(int level);
|
2013-05-01 14:52:55 +02:00
|
|
|
|
|
|
|
/* */
|
|
|
|
void capwap_logging_disable_allinterface();
|
|
|
|
void capwap_logging_enable_console(int error);
|
2013-06-16 12:09:57 +02:00
|
|
|
void capwap_logging_disable_console(void);
|
2013-05-01 14:52:55 +02:00
|
|
|
|
|
|
|
/* */
|
|
|
|
#ifdef ENABLE_LOGGING
|
2016-03-30 14:30:27 +02:00
|
|
|
void log_printf(int level, const char *format, ...)
|
|
|
|
__attribute__ ((__format__ (__printf__, 2, 3)));
|
2016-03-30 14:29:53 +02:00
|
|
|
void log_hexdump(int level, const char *title, const unsigned char *data, size_t len);
|
2013-05-01 14:52:55 +02:00
|
|
|
#else
|
2016-03-30 14:29:53 +02:00
|
|
|
#define log_printf(l, f, args...) do { } while (0)
|
|
|
|
#define log_hexdump(l, t, d, len) do { } while (0)
|
2013-05-01 14:52:55 +02:00
|
|
|
#endif
|
|
|
|
|
2016-03-30 14:29:53 +02:00
|
|
|
#define capwap_logging_printf log_printf
|
|
|
|
#define capwap_logging_hexdump log_hexdump
|
2016-02-29 14:23:58 +01:00
|
|
|
|
2013-05-01 14:52:55 +02:00
|
|
|
/* */
|
2016-03-30 14:29:53 +02:00
|
|
|
#define capwap_logging_fatal(f, args...) \
|
|
|
|
log_printf(LOG_EMERG, f, ##args)
|
|
|
|
#define capwap_logging_error(f, args...) \
|
|
|
|
log_printf(LOG_ERR, f, ##args)
|
|
|
|
#define capwap_logging_warning(f, args...) \
|
|
|
|
log_printf(LOG_WARNING, f, ##args)
|
|
|
|
#define capwap_logging_info(f, args...) \
|
|
|
|
log_printf(LOG_INFO, f, ##args)
|
2013-05-03 22:28:06 +02:00
|
|
|
|
|
|
|
#ifdef DISABLE_LOGGING_DEBUG
|
|
|
|
#define capwap_logging_debug(f, args...)
|
|
|
|
#else
|
2016-03-30 14:29:53 +02:00
|
|
|
#define capwap_logging_debug(f, args...) \
|
|
|
|
log_printf(LOG_DEBUG, f, ##args)
|
2013-05-03 22:28:06 +02:00
|
|
|
#endif
|
2013-05-01 14:52:55 +02:00
|
|
|
|
|
|
|
#endif /* __CAPWAP_LOGGING_HEADER__ */
|