examples/coap-rd.c: Replace debug() with coap_log(LOG_DEBUG, )

This commit is contained in:
Jon Shallow committed 2018-05-17 18:45:07 +01:00
1 parent 843f036b16
commit 032a46fcb3
1 file changed
+7 -5
+7 -5
View File
@@ -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;
}