libcoap icon indicating copy to clipboard operation
libcoap copied to clipboard

Logging: Make logging consistent across (D)TLS libraries

Open mrdeep1 opened this issue 2 years ago • 0 comments

Set up coap_log_t as an enum, using syslog variable names prefixed by COAP_.

Add function coap_dtls_log() for logging information from (D)TLS libraries.

Update the log output to have a prefix of DTLS- for the logging levels to indicate that output is from the (D)TLS library instead of the CoAP library.

(D)TLS libraries updated to be consistent in the usage of coap_dtls_set_log_level()/coap_dtls_get_log_level().

Add in coap_log_emerg(), coap_log_alert() etc. as wrappers to reduce the line length required for log entries. Updating all the coap_log() functions to no longer use syslog variants will be a part of a separate PR.

Added in the "-V" option to the examples, with an initial default of COAP_LOG_WARN, separating out the CoAP and (D)TLS logging levels.

Note: TinyDTLS log output will be consistent when built against a TinyDTLS version that contains support for an external logging handler.

Closes #871

mrdeep1 avatar Jul 30 '22 15:07 mrdeep1