← Back to Pull requests

[#1664] Use originating function name as log origin instead of Debug dump #1859

Closed
unknown closed this pull request without merging on Aug 07, 2026 01:54 UTC
View on GitHub
unknown unknown commented on Jul 29, 2026 04:04 UTC
Author

Notes for Reviewer

Follow up to the discussion in #1664, covering the "shorter origin" part only. PID and executable name are not in here, for the reasons in the issue comment.

29 call sites built their log origin with format!("{self:?}"), which dumps the whole builder. For a service builder warning that comes to 6493 characters, and the identifying parts sit far enough in that truncating in the logger doesn't help. service_name starts at char 280, the name itself at 352.

This replaces them with the name of the originating function, which is what the other 133 origin sites in the tree already do (let origin = "Config::global_config()"; and so on). Before:

0 [W] "Builder { base: BuilderWithServiceType { service_config: StaticConfig { iceoryx2_version: PackageVersion { ... 6493 chars ... }"
| Setting the subscribers max borrowed samples to 0 is not supported. Adjust it to 1, the smallest supported value.

After:

0 [W] "publish_subscribe::Builder::adjust_configuration_to_meaningful_values()"
| Setting the subscribers max borrowed samples to 0 is not supported. Adjust it to 1, the smallest supported value.

Two things worth mentioning:

Most of these sites used format!("{self:?}") because self gets moved or mutably borrowed further down, so a Debug snapshot was the easy way to keep something to log. A &'static str sidesteps that, and drops an allocation from each of these paths, which is a small step towards #1450.

Removing the format! calls left 17 use alloc::format; imports unused, so those are gone too. I checked each file has no remaining format! usage rather than relying on the warning alone, in case any were feature gated.

No behaviour change beyond the log text. cargo fmt, cargo clippy --workspace --all-targets and cargo test --workspace are clean on aarch64 macOS. The one clippy warning in iceoryx2-bb-posix is present on main too.

Naming is the part I would most like input on. I used Type::method(), module qualified where the type name alone would be ambiguous, e.g. posix_shared_memory::Connector::open_sender(). Happy to change the scheme, it is a single line per site.

Pre-Review Checklist for the PR Author

[x] Add sensible notes for the reviewer
[x] PR title is short, expressive and meaningful
[ ] Consider switching the PR to a draft (Convert to draft)
[x] Relevant issues are linked in the References section
[x] Branch follows the naming format (iox2-1664-replace-debug-dump-origins)
[x] Commits messages are according to commit message guidelines
[x] Commit messages have the issue ID ([#1664])
[ ] Tests follow best practice for testing guidelines - no new tests, log output only, see notes

  • Changelog updated in the unreleased section including API breaking changes
  • References

    Relates to #1664

    Diff: 355 lines (+266 / -89) across 4 files Reviewer: Nawazz-ish Review duration: 12829m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.43) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 355 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.351
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1859"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.5% (MEDIUM) · Higher = larger blast radius
    42.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.4% · Safe to merge
    18.4%