#include "config.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <arpa/inet.h>
#include <time.h>
#include "debug.h"
#include "net.h"
Go to the source code of this file.
|
#define | min(a, b) ((a) < (b) ? (a) : (b)) |
|
|
coap_log_t | coap_get_log_level () |
| Returns the current log level. More...
|
|
void | coap_set_log_level (coap_log_t level) |
| Sets the log level to the specified value. More...
|
|
static size_t | print_timestamp (char *s, size_t len, coap_tick_t t) |
|
unsigned int | print_readable (const unsigned char *data, unsigned int len, unsigned char *result, unsigned int buflen, int encode_always) |
|
size_t | coap_print_addr (const struct coap_address_t *addr, unsigned char *buf, size_t len) |
|
void | coap_show_pdu (const coap_pdu_t *pdu) |
|
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_WARNING ). More...
|
|
#define min |
( |
|
a, |
|
|
|
b |
|
) |
| ((a) < (b) ? (a) : (b)) |
Returns the current log level.
Definition at line 41 of file debug.c.
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_WARNING
).
The text is output only when level
is below or equal to the log level that set by coap_set_log_level().
Definition at line 325 of file debug.c.
size_t coap_print_addr |
( |
const struct coap_address_t * |
addr, |
|
|
unsigned char * |
buf, |
|
|
size_t |
len |
|
) |
| |
Sets the log level to the specified value.
Definition at line 46 of file debug.c.
unsigned int print_readable |
( |
const unsigned char * |
data, |
|
|
unsigned int |
len, |
|
|
unsigned char * |
result, |
|
|
unsigned int |
buflen, |
|
|
int |
encode_always |
|
) |
| |
static size_t print_timestamp |
( |
char * |
s, |
|
|
size_t |
len, |
|
|
coap_tick_t |
t |
|
) |
| |
|
inlinestatic |
Initial value:= {
"EMRG", "ALRT", "CRIT", "ERR", "WARN", "NOTE", "INFO", "DEBG"
}
Definition at line 51 of file debug.c.