Skip to content
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
merged 13 commits into from
May 29, 2024

Conversation

LukasWoodtli
Copy link
Contributor

Alternative to #748

  • Improved formatting
  • Fix naming of C define
  • Use CMake cache variables for logging configuration

.clang-format Outdated Show resolved Hide resolved
@LukasWoodtli LukasWoodtli force-pushed the lw/cmake_defines_logging branch 3 times, most recently from ff8fb3e to c7c3022 Compare April 25, 2024 09:58
@mlasch
Copy link
Contributor

mlasch commented May 24, 2024

Nice improvement, this surely makes tracing problems easier in the future.

core/internals.h Outdated Show resolved Hide resolved
@LukasWoodtli LukasWoodtli force-pushed the lw/cmake_defines_logging branch 8 times, most recently from 7a94ed0 to 03fdb7b Compare May 24, 2024 17:13
@LukasWoodtli LukasWoodtli marked this pull request as ready for review May 24, 2024 19:31
@LukasWoodtli LukasWoodtli requested a review from mlasch May 24, 2024 19:31
README.md Outdated Show resolved Hide resolved
wakaama.cmake Show resolved Hide resolved
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.
Copy link

sonarcloud bot commented May 29, 2024

Quality Gate Passed Quality Gate passed

Issues
95 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.3% Duplication on New Code

See analysis details on SonarCloud

@mlasch mlasch self-requested a review May 29, 2024 12:50
@mlasch mlasch merged commit 22bf6e1 into eclipse-wakaama:main May 29, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants