Skip to content

log: Add String method to Value and KeyValue#5117

Merged
pellared merged 5 commits intoopen-telemetry:mainfrom
pellared:log-kv-string
Apr 2, 2024
Merged

log: Add String method to Value and KeyValue#5117
pellared merged 5 commits intoopen-telemetry:mainfrom
pellared:log-kv-string

Conversation

@pellared
Copy link
Copy Markdown
Member

@pellared pellared commented Mar 29, 2024

Fixes #4952

Implementation based on: https://pkg.go.dev/log/slog#Value.String and https://pkg.go.dev/log/slog#Attr.String.

Comment that it is for debugging purpose only inspired by https://pkg.go.dev/time#Time.String

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 29, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 83.8%. Comparing base (b7fdeb9) to head (664c409).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #5117     +/-   ##
=======================================
- Coverage   83.8%   83.8%   -0.1%     
=======================================
  Files        248     248             
  Lines      16253   16275     +22     
=======================================
+ Hits       13625   13643     +18     
- Misses      2340    2344      +4     
  Partials     288     288             
Files Coverage Δ
log/keyvalue.go 96.7% <90.9%> (-1.0%) ⬇️

... and 1 file with indirect coverage changes

@pellared pellared marked this pull request as ready for review March 29, 2024 09:15
@pellared pellared self-assigned this Mar 29, 2024
@pellared pellared added area:logs Part of OpenTelemetry logs pkg:API Related to an API package labels Mar 29, 2024
Comment thread log/keyvalue.go Outdated
Comment thread CHANGELOG.md Outdated
pellared and others added 2 commits March 29, 2024 17:49
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
@pellared pellared requested a review from MrAlias March 29, 2024 16:54
Copy link
Copy Markdown
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

🚀

@pellared pellared merged commit e6e44de into open-telemetry:main Apr 2, 2024
@MrAlias MrAlias added this to the v1.25.0 milestone Apr 3, 2024
@pellared pellared deleted the log-kv-string branch May 20, 2025 08:59
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 pkg:API Related to an API package

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

log: Implement Stringer for Value and KeyValue

4 participants