10 #define _COAP_DEBUG_H_
15 #define COAP_DEBUG_FD stdout
19 #define COAP_ERR_FD stderr
27 typedef enum { LOG_EMERG=0, LOG_ALERT, LOG_CRIT, LOG_WARNING,
28 LOG_NOTICE, LOG_INFO, LOG_DEBUG
47 #define coap_log(...) coap_log_impl(__VA_ARGS__)
53 #define info(...) coap_log(LOG_INFO, __VA_ARGS__)
54 #define warn(...) coap_log(LOG_WARNING, __VA_ARGS__)
55 #define debug(...) coap_log(LOG_DEBUG, __VA_ARGS__)
60 struct coap_address_t;
61 size_t coap_print_addr(
const struct coap_address_t *,
unsigned char *,
size_t);
69 #define coap_show_pdu(x)
70 #define coap_print_addr(...)
void coap_show_pdu(const coap_pdu_t *)
void coap_log_impl(coap_log_t level, const char *format,...)
Writes the given text to COAP_ERR_FD (for level <= LOG_CRIT) or COAP_DEBUG_FD (for level >= LOG_WARNI...
void coap_set_log_level(coap_log_t level)
Sets the log level to the specified value.
Header structure for CoAP PDUs.
coap_log_t coap_get_log_level()
Returns the current log level.
size_t coap_print_addr(const struct coap_address_t *, unsigned char *, size_t)