-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging and CMake config #766
Merged
mlasch
merged 13 commits into
eclipse-wakaama:main
from
husqvarnagroup:lw/cmake_defines_logging
May 29, 2024
Merged
Logging and CMake config #766
mlasch
merged 13 commits into
eclipse-wakaama:main
from
husqvarnagroup:lw/cmake_defines_logging
May 29, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
LukasWoodtli
force-pushed
the
lw/cmake_defines_logging
branch
from
April 25, 2024 06:40
fdee3a4
to
80c0f78
Compare
LukasWoodtli
force-pushed
the
lw/cmake_defines_logging
branch
3 times, most recently
from
April 25, 2024 09:58
ff8fb3e
to
c7c3022
Compare
Nice improvement, this surely makes tracing problems easier in the future. |
mlasch
reviewed
May 24, 2024
LukasWoodtli
force-pushed
the
lw/cmake_defines_logging
branch
8 times, most recently
from
May 24, 2024 17:13
7a94ed0
to
03fdb7b
Compare
LukasWoodtli
force-pushed
the
lw/cmake_defines_logging
branch
from
May 27, 2024 09:57
447ec05
to
a652534
Compare
mlasch
reviewed
May 29, 2024
All the logging used "\r\n" as line ending characters. This is kept for Windows but it is changed to "\n" on all other systems.
The tests check if the expected output for logging is produced.
Some string format specifiers need adjustments for modern C.
The handler function defines how the log messages are formatted. It can be used for future customization.
The custom handler function can be used to overwrite the defalut log message handler. It is used to format the message and to define where it is written to. Also filtering can be applied.
Additional macros are now used to allow to log to a specific level. The default log level is 'debug'.
The default logging macros (`LOG_DBG` and related) allow now the use of arguments. The support is limited to the case, when the format string is a literal. This is due to limitations __VA_ARGS__ in C11.
The important logging functionality was docummented.
A function was introduced for the logging text formatting to reduce the memory footprint.
The logging infrastructure can be configured with CMake cache variables. This is a step towards a more modern CMake project. Logging in tests is disabled as it conflicts with the 'new' way of configuring logging. These tests will be activated again later.
The examples conflict with the logging tests so they can be disabled if not needed.
Using cache variables to configure the logging infrastructure requires a different handling for testing. CMake's preset functionality helps to build the project with different settings and run the corresponding tests.
The logging handler function can be customized. Therefore it belongs into to puplic header of Wakaama.
LukasWoodtli
force-pushed
the
lw/cmake_defines_logging
branch
from
May 29, 2024 12:44
a652534
to
f84168a
Compare
Quality Gate passedIssues Measures |
mlasch
approved these changes
May 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Alternative to #748