Replace debug(), info() & warn() macros with appropriate coap_log()

This then removes the need for name polution/confict of debug(), info() and
warn() when building other projects that use libcoap and need to #include the
libcoap header files

Updated:
 examples/client.c
 examples/contiki/coap-observer.c
 examples/etsi_iot_01.c
 include/coap2/debug.h
 src/async.c
 src/block.c
 src/coap_io.c
 src/coap_openssl.c
 src/coap_session.c
 src/coap_tinydtls.c
 src/debug.c
 src/mem.c
 src/net.c
 src/option.c
 src/pdu.c
 src/resource.c
 src/uri.c

If the debug() etc. macros are still required, then the change to
include/coap2/debug.h just needs to be reverted.

There are also a couple of space changes - to cause log output to be columnar
e.g "ERR" was padded to "ERR ", so that "EMRG" or "ERR " log output output was
aligned in the same way.

This is a replacement for PR#51, and partially deals with name polution issues
raised in Issue #50.

Parameter re-aligned some long strings, splitting strings across multiple lines
This commit is contained in:
Jon Shallow committed 2018-11-10 20:27:50 +00:00
1 parent 3c75958f33
commit 04ced3e5e5
17 files changed
+357 -240

No files matched your search

-17
View File
@@ -125,23 +125,6 @@ void coap_log_impl(coap_log_t level, const char *format, ...);
} while(0)
#endif
/* A set of convenience macros for common log levels. */
/**
* Obsoleted.
* @deprecated Use coap_log(LOG_INFO, ...) instead.
*/
#define info(...) coap_log(LOG_INFO, __VA_ARGS__)
/**
* Obsoleted.
* @deprecated Use coap_log(LOG_WARNING, ...) instead.
*/
#define warn(...) coap_log(LOG_WARNING, __VA_ARGS__)
/**
* Obsoleted.
* @deprecated Use coap_log(LOG_DEBUG, ...) instead.
*/
#define debug(...) coap_log(LOG_DEBUG, __VA_ARGS__)
#include "pdu.h"
/**