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

logs: Add empty value for KeyValue #5076

Merged
merged 6 commits into from
Mar 15, 2024
Merged

Conversation

XSAM
Copy link
Member

@XSAM XSAM commented Mar 14, 2024

resolves #4953

I find log.Empty is useful when using log.MapValue. For that, we can have a consistent user experience while adding key values to the map.

log.MapValue(
	log.Slice("l", log.IntValue(3), log.StringValue("foo")),
	log.Bytes("b", []byte{3, 5, 7}),
	log.Empty("e"),
)

Copy link

codecov bot commented Mar 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.2%. Comparing base (42c1708) to head (4a5e0e3).

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #5076   +/-   ##
=====================================
  Coverage   83.2%   83.2%           
=====================================
  Files        243     243           
  Lines      15908   15910    +2     
=====================================
+ Hits       13245   13247    +2     
  Misses      2375    2375           
  Partials     288     288           
Files Coverage Δ
log/keyvalue.go 97.6% <100.0%> (+<0.1%) ⬆️

Copy link
Member

@pellared pellared left a comment

Choose a reason for hiding this comment

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

LGTM 👍 I left just a few comments that should be resolved.

CHANGELOG.md Outdated Show resolved Hide resolved
log/keyvalue.go Outdated Show resolved Hide resolved
log/keyvalue.go Outdated Show resolved Hide resolved
@MrAlias MrAlias added the area:logs Part of OpenTelemetry logs label Mar 14, 2024
XSAM and others added 3 commits March 14, 2024 22:25
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
log/keyvalue.go Outdated Show resolved Hide resolved
Co-authored-by: Damien Mathieu <42@dmathieu.com>
@pellared pellared requested a review from dmathieu March 15, 2024 10:19
@MrAlias MrAlias merged commit 47ac0d4 into open-telemetry:main Mar 15, 2024
25 checks passed
@XSAM XSAM deleted the empty-value branch March 15, 2024 16:50
@MrAlias MrAlias added this to the v1.25.0 milestone Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:logs Part of OpenTelemetry logs
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

log: Empty Value
5 participants