From 032a46fcb39d0df7e44e6548e70aa7784a901c42 Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Thu, 5 Apr 2018 21:14:56 +0100 Subject: [PATCH] examples/coap-rd.c: Replace debug() with coap_log(LOG_DEBUG, ) --- examples/coap-rd.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/coap-rd.c b/examples/coap-rd.c index dd817c1b..337210ea 100644 --- a/examples/coap-rd.c +++ b/examples/coap-rd.c @@ -149,7 +149,8 @@ hnd_put_resource(coap_context_t *ctx UNUSED_PARAM, tmp.s = (unsigned char *)coap_malloc(tmp.length); if (!tmp.s) { - debug("hnd_put_rd: cannot allocate storage for new rd\n"); + coap_log(LOG_DEBUG, + "hnd_put_rd: cannot allocate storage for new rd\n"); code = COAP_RESPONSE_CODE(503); goto finish; } @@ -179,7 +180,8 @@ hnd_put_resource(coap_context_t *ctx UNUSED_PARAM, response = coap_pdu_init(type, code, request->hdr->id, size); if (!response) { - debug("cannot create response for message %d\n", request->hdr->id); + coap_log(LOG_DEBUG, "cannot create response for message %d\n", + request->hdr->id); return; } @@ -187,7 +189,7 @@ hnd_put_resource(coap_context_t *ctx UNUSED_PARAM, coap_add_token(response, request->hdr->token_length, request->hdr->token); if (coap_send(ctx, peer, response) == COAP_INVALID_TID) { - debug("hnd_get_rd: cannot send response for message %d\n", + coap_log(LOG_DEBUG, "hnd_get_rd: cannot send response for message %d\n", request->hdr->id); } #endif @@ -356,14 +358,14 @@ make_rd(coap_pdu_t *pdu) { rd = rd_new(); if (!rd) { - debug("hnd_get_rd: cannot allocate storage for rd\n"); + coap_log(LOG_DEBUG, "hnd_get_rd: cannot allocate storage for rd\n"); return NULL; } if (coap_get_data(pdu, &rd->data.length, &data)) { rd->data.s = (unsigned char *)coap_malloc(rd->data.length); if (!rd->data.s) { - debug("hnd_get_rd: cannot allocate storage for rd->data\n"); + coap_log(LOG_DEBUG, "hnd_get_rd: cannot allocate storage for rd->data\n"); rd_delete(rd); return NULL; }