Skip to content

[#464] c api #466

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

Merged
merged 10 commits into from
Oct 16, 2024
Merged

[#464] c api #466

merged 10 commits into from
Oct 16, 2024

Conversation

elfenpiff
Copy link
Contributor

@elfenpiff elfenpiff commented Oct 14, 2024

Notes for Reviewer

  • Implements the C and C++ binding for log.
  • It renames the Logger trait for custom loggers to Log to be more in line with the Rust naming scheme - traits are verbs
  • provides user convenience functions to set the file logger as default logger

Pre-Review Checklist for the PR Author

  1. Add sensible notes for the reviewer
  2. PR title is short, expressive and meaningful
  3. Relevant issues are linked in the References section
  4. Every source code file has a copyright header with SPDX-License-Identifier: Apache-2.0 OR MIT
  5. Branch follows the naming format (iox2-123-introduce-posix-ipc-example)
  6. Commits messages are according to this guideline
  7. Tests follow the best practice for testing
  8. Changelog updated in the unreleased section including API breaking changes
  9. Assign PR to reviewer
  10. All checks have passed (except task-list-completed)

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Unit tests have been written for new behavior
  • Public API is documented
  • PR title describes the changes

Post-review Checklist for the PR Author

  1. All open points are addressed and tracked via issues

References

Relates to #464

@elfenpiff elfenpiff requested a review from elBoberido October 14, 2024 19:07
@elfenpiff elfenpiff self-assigned this Oct 14, 2024
@elfenpiff elfenpiff changed the title [#464] c api [BASED ON #465] [#464] c api Oct 14, 2024
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 7.69231% with 12 lines in your changes missing coverage. Please review.

Project coverage is 78.90%. Comparing base (6f20ebd) to head (4f105f3).
Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
iceoryx2-bb/log/src/logger/mod.rs 0.00% 11 Missing ⚠️
iceoryx2-bb/log/src/lib.rs 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #466      +/-   ##
==========================================
- Coverage   79.00%   78.90%   -0.10%     
==========================================
  Files         197      198       +1     
  Lines       23637    23650      +13     
==========================================
- Hits        18674    18662      -12     
- Misses       4963     4988      +25     
Files with missing lines Coverage Δ
iceoryx2-bb/log/src/logger/buffer.rs 0.00% <ø> (ø)
iceoryx2-bb/log/src/logger/console.rs 51.82% <ø> (ø)
iceoryx2-bb/log/src/logger/file.rs 0.00% <ø> (ø)
iceoryx2-bb/log/src/lib.rs 64.00% <50.00%> (ø)
iceoryx2-bb/log/src/logger/mod.rs 0.00% <0.00%> (ø)

... and 10 files with indirect coverage changes

@elfenpiff elfenpiff changed the title [BASED ON #465] [#464] c api [#464] c api Oct 15, 2024
log(LogLevel::Trace, "hello", "world");
log(LogLevel::Debug, "goodbye", "hypnotoad");
log(LogLevel::Info, "Who is looking for freedom?", "The Hoff!");
log(LogLevel::Warn, "Blümchen", "Bassface");
log(LogLevel::Error, "Blümchen should record a single with", "The almighty Hypnotoad");
log(LogLevel::Fatal, "It is the end", "my beloved toad.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it make sense to just use the iceoryx1 logging mechanism and forward the messages to the Rust logger?

We would basically get lazy evaluation for free and also logging complex messages without having to stringify it first.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to talk about this. I lean to prefer that we have one single mechanism and that in the future - iceoryx2_hoofs would then also use it.

But the lazy evaluation and the existing infrastructure is a strong argument to not dismiss what we already have.

Maybe we can merge both of them together ...

@elfenpiff elfenpiff merged commit e2c9afe into eclipse-iceoryx:main Oct 16, 2024
40 checks passed
@elfenpiff elfenpiff deleted the iox2-464-c-api branch October 16, 2024 09:40
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.

3 participants