pkg/tinydtls: only build debug log when tinydtls_debug is enabled #18907
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
tinydtls allows to switch the log level at run-time, which means all debug strings have to be present in ROM.
This is pretty wasteful, so define a
tinydtls_debug
module without which those debug facilities are dropped, saving ~20k ROM on Cortex-M0.This also hooks the tinydtls log into RIOT's log facility, so even with
tinydtls_debug
enabled messages below the log level set in RIOT are dropped.Dynamic log level switching does no longer work, but we don't have this in RIOT so we don't need it for this module.
Testing procedure
Build
examples/dtls-sock
master
this PR
Issues/PRs references
Upstream PR: eclipse/tinydtls#177