From e77c3565cb306069ec2a74a3e171927eb308d25a Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Thu, 3 Aug 2017 15:24:36 +0200 Subject: [PATCH] client.c: show outgoing and received PDUs in log level INFO coap-client now prints PDUs that are sent and received in log level INFO so that these are output with '-v6' or higher. These messages are now visible without turning on the full debug. --- examples/client.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/client.c b/examples/client.c index 112ec6fe..340fb90a 100644 --- a/examples/client.c +++ b/examples/client.c @@ -161,8 +161,6 @@ coap_new_request(coap_context_t *ctx, debug("cannot add token to request\n"); } - coap_show_pdu(pdu); - if (options) { /* sort options for delta encoding */ LL_SORT((*options), order_opts); @@ -332,7 +330,7 @@ message_handler(struct coap_context_t *ctx, coap_tid_t tid; #ifndef NDEBUG - if (LOG_DEBUG <= coap_get_log_level()) { + if (LOG_INFO <= coap_get_log_level()) { debug("** process incoming %d.%02d response:\n", (received->hdr->code >> 5), received->hdr->code & 0x1F); coap_show_pdu(received); @@ -1297,7 +1295,7 @@ main(int argc, char **argv) { } #ifndef NDEBUG - if (LOG_DEBUG <= coap_get_log_level()) { + if (LOG_INFO <= coap_get_log_level()) { debug("sending CoAP request:\n"); coap_show_pdu(pdu); }