Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[API] Change the param-pack unpacking order to start from left to right #3296

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

Conversation

ThomsonTan
Copy link
Contributor

@ThomsonTan ThomsonTan commented Mar 11, 2025

Changes

The parameter pack sent to EmitLogRecord is unpacked from right to left, which are caused by passing them as function parameters to template function IgnoreTraitResult. This will send the rightmost attributes parameter to the processor and then pass it to the Recordable. It makes it a little hard to do serialization in the Recordable interface, because the serialization usually needs to encode the data like event name or severity before encoding the attributes.

This PR changes the unpack order to help do serialization in the Recordable interface in a straightforward way, without caching any attributes.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@ThomsonTan ThomsonTan requested a review from a team as a code owner March 11, 2025 00:46
Copy link

netlify bot commented Mar 11, 2025

Deploy Preview for opentelemetry-cpp-api-docs canceled.

Name Link
🔨 Latest commit dc03d42
🔍 Latest deploy log https://app.netlify.com/sites/opentelemetry-cpp-api-docs/deploys/67cf94e597947200088317e5

Copy link

codecov bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.41%. Comparing base (edfeabe) to head (dc03d42).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3296      +/-   ##
==========================================
+ Coverage   89.41%   89.41%   +0.01%     
==========================================
  Files         207      207              
  Lines        6457     6458       +1     
==========================================
+ Hits         5773     5774       +1     
  Misses        684      684              
Files with missing lines Coverage Δ
api/include/opentelemetry/logs/logger.h 63.83% <100.00%> (+0.79%) ⬆️
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marcalff marcalff changed the title Change the param-pack unpacking order to start from left to right [API] Change the param-pack unpacking order to start from left to right Mar 11, 2025
@marcalff marcalff merged commit 64a74bf into open-telemetry:main Mar 11, 2025
58 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.

4 participants