Skip to content

Conversation

@orecham
Copy link
Contributor

@orecham orecham commented Dec 5, 2025

Notes for Reviewer

NOTE: THE APPROACH HAS BEEN MODIFIED SINCE INITIAL SUBMISSION

This PR separates the logging API and logger implementation into separate crates:

  1. iceoryx2-log - front-end logging API
  2. iceoryx2-loggers - back-end logger implementations

The default logging implementation can be selected via feature flags (e.g. logger_console). Only one default logger can be selected at any time. The default logger is automatically used if there are no other loggers set at runtime.

All binaries are required to link to the iceoryx2_loggers crate somehow.
This is automatically done when using the iceoryx2 crate as a dependency, however if using any other crate in the workspace separately, this must be handled manually by adding dependency to iceoryx2_loggers and specifying the following to ensure the crate is linked even when not directly used:

extern crate iceoryx2_loggers;
Previous Version

Users are required to explicitly select and set their desired logger implementation at runtime:

use iceoryx2::prelude::*;
use iceoryx2_loggers::console::Logger;

static LOGGER: Logger = Logger::new();

fn main() {
    set_logger(&LOGGER);
    set_log_level_from_env_or(LogLevel::Info);
    info!("Some log message");
}

This change sets up the foundation for:

  1. Utilization of the logging API throughout all iceoryx2 crates, including iceoryx2-pal-posix
  2. Implementation of a logging backend using iceoryx2-bb-posix to support logging on all POSIX platforms, even if they are no_std

Pre-Review Checklist for the PR Author

  • Add sensible notes for the reviewer
  • PR title is short, expressive and meaningful
  • Relevant issues are linked in the References section
  • Branch follows the naming format (iox2-123-introduce-posix-ipc-example)
  • Commits messages are according to this guideline
    • Commit messages have the issue ID ([#123] Add posix ipc example)
    • Keep in mind to use the same email that was used to sign the Eclipse Contributor Agreement
  • Tests follow the best practice for testing
  • Changelog updated in the unreleased section including API breaking changes
  • Assign PR to reviewer
  • All checks have passed (except task-list-completed)

PR Reviewer Reminders

  • 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

References

Relates #154

@orecham orecham changed the title [#154] separate logger frontend and backend [#154] Separate logger frontend and backend Dec 5, 2025
@orecham orecham force-pushed the iox2-154-separate-logger-frontend-and-backend branch from 5d610ff to 5f0689e Compare December 5, 2025 14:09
@orecham orecham self-assigned this Dec 5, 2025
@orecham orecham force-pushed the iox2-154-separate-logger-frontend-and-backend branch 2 times, most recently from 976f6c2 to 2664257 Compare December 8, 2025 05:28
@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 64.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.17%. Comparing base (cca0ed3) to head (20437c7).
⚠️ Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
iceoryx2-log/loggers/src/console.rs 0.00% 7 Missing ⚠️
iceoryx2-log/log/src/lib.rs 88.23% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1224      +/-   ##
==========================================
- Coverage   78.39%   78.17%   -0.22%     
==========================================
  Files         410      412       +2     
  Lines       40988    41001      +13     
  Branches     1093     1117      +24     
==========================================
- Hits        32131    32051      -80     
- Misses       8026     8094      +68     
- Partials      831      856      +25     
Flag Coverage Δ
CPP 72.39% <ø> (-0.30%) ⬇️
Rust 78.00% <64.00%> (-0.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
iceoryx2-bb/container/src/flatmap.rs 78.86% <ø> (ø)
iceoryx2-bb/container/src/queue.rs 91.44% <ø> (ø)
iceoryx2-bb/container/src/semantic_string.rs 83.56% <ø> (ø)
iceoryx2-bb/container/src/slotmap.rs 90.00% <ø> (ø)
iceoryx2-bb/container/src/string/mod.rs 100.00% <ø> (ø)
...ryx2-bb/container/src/string/relocatable_string.rs 70.29% <ø> (ø)
iceoryx2-bb/container/src/string/static_string.rs 85.14% <ø> (ø)
iceoryx2-bb/container/src/vec.rs 74.04% <ø> (ø)
iceoryx2-bb/container/src/vector/mod.rs 98.29% <ø> (ø)
...ceoryx2-bb/container/src/vector/polymorphic_vec.rs 70.27% <ø> (-13.52%) ⬇️
... and 115 more

... and 17 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@orecham orecham force-pushed the iox2-154-separate-logger-frontend-and-backend branch 4 times, most recently from a4bc24e to 82f4eb0 Compare December 9, 2025 23:50
@orecham orecham force-pushed the iox2-154-separate-logger-frontend-and-backend branch 2 times, most recently from 9da8a5f to 81d277b Compare December 10, 2025 00:10
@orecham orecham force-pushed the iox2-154-separate-logger-frontend-and-backend branch from 81d277b to 46e87d9 Compare December 10, 2025 09:10
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.

2 participants