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

Implement logging infrastructure. #690

Merged
merged 2 commits into from Feb 20, 2023
Merged

Implement logging infrastructure. #690

merged 2 commits into from Feb 20, 2023

Conversation

1uc
Copy link
Collaborator

@1uc 1uc commented Feb 19, 2023

Implements basic logging infrastructure for human readable amounts of messages. The design idea is that any user of HighFive can optionally specify a backend logger by registering a callback.

The logging API consists of:

HIGHFIVE_LOG_{DEBUG,INFO,WARN,ERROR}(message)
HIGHFIVE_LOG_*_IF(cond, message)

The former forwards the message with the appropriate log severity along with the filename and line number to the logging callback. The latter does so only if the if-statement is true. It's important to avoid any side effects in cond since the macro might expand to a no-op if the compile time minimum log severity is too high. Therefore, cond wont be evaluated and the side effects wont happen.

Future work could add additional more advanced features. Alternatively, users that wish to have more advanced features could register an backend logging library that supports the desired features.

@codecov-commenter
Copy link

Codecov Report

Merging #690 (f2352b9) into master (4d29dee) will increase coverage by 0.24%.
The diff coverage is 88.88%.

@@            Coverage Diff             @@
##           master     #690      +/-   ##
==========================================
+ Coverage   81.16%   81.40%   +0.24%     
==========================================
  Files          67       67              
  Lines        4151     4244      +93     
==========================================
+ Hits         3369     3455      +86     
- Misses        782      789       +7     
Impacted Files Coverage Δ
include/highfive/bits/H5Object_misc.hpp 89.74% <0.00%> (ø)
include/highfive/bits/H5ReadWrite_misc.hpp 73.33% <66.66%> (+4.58%) ⬆️
include/highfive/H5Utility.hpp 78.04% <72.72%> (-21.96%) ⬇️
tests/unit/tests_high_five_base.cpp 99.61% <100.00%> (+0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@1uc 1uc requested a review from alkino February 20, 2023 07:45
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